reportEvent method

void reportEvent(
  1. String name, {
  2. Map<String, String> attributes = const {},
})

Adds a span event. Attribute keys are sanitized and prefixed with vunet.action.; the event name is not.

Implementation

void reportEvent(String name, {Map<String, String> attributes = const {}}) {
  final span = _activeSpan();
  if (span == null) return;
  if (attributes.isEmpty) {
    span.addEvent(name);
  } else {
    span.addEvent(
      name,
      attributes: [
        for (final entry in attributes.entries)
          Attribute.fromString(_actionAttrKey(entry.key), entry.value),
      ],
    );
  }
}