Execution tags are now supported also in Containers!
We hear a lot from users that execution tags are one of Lumigo's most powerful features. Through execution tags, you can mark, filter and alert invocations based on data like on behalf of which of your customers did the invocation run. Developer Steve gave an excellent overview of execution tags in this Quick Bytes video.
Executions tags and OpenTelemetry
Until now, execution tags were limited to the Node.js and Python Lumigo Lambda tracers. Today, any OpenTelemetry tracer, including but not limited to the Lumigo OpenTelemetry distributions, can send execution tags to Lumigo using OpenTelemetry's Span.setAttribute(key, value)
API.
This is how you can set the execution tag foo
to the value bar
via the Lumigo OpenTelemetry Distributions for JS and Python:
// Typescript
import { trace } from '@opentelemetry/api';
// Note: 'trace.getActiveSpan()' is available from version 1.8.0 of the Lumigo OpenTelemetry Distro for JS
trace.getActiveSpan()?.setAttribute('lumigo.execution_tags.foo','bar');
// Javascript
const { trace } = require('@opentelemetry/api');
// Note: 'trace.getActiveSpan()' is available from version 1.8.0 of the Lumigo OpenTelemetry Distro for JS
trace.getActiveSpan().setAttribute('lumigo.execution_tags.foo','bar');
// Python
from opentelemetry.trace import get_current_span
get_current_span().set_attribute('lumigo.execution_tags.foo','bar');
Setting multiple values to the execution tag is also supported (this time, both bar
and baz
):
// Typescript
import { trace } from '@opentelemetry/api';
trace.getActiveSpan()?.setAttribute('lumigo.execution_tags.foo',['bar','baz']);
// Javascript
const { trace } = require('@opentelemetry/api');
trace.getActiveSpan()?.setAttribute('lumigo.execution_tags.foo',['bar','baz']);
}
// Python
from opentelemetry.trace import get_current_span
get_current_span().set_attribute('lumigo.execution_tags.foo',('bar','baz',)); # Both lists and tuples work
The APIs of OpenTelemetry SDKs for other programming languages differ slightly, but the gist of the matter is: if an OpenTelemetry tracer can send span attributes (and they all can :D), they can send execution tags to Lumigo!
End-to-end filtering
Lambda and container tracers use different APIs to set execution tags, but you can filter by execution tags in Explore irrespective of their source:
Requirements
Execution tags rely on the Span.setAttribute
OpenTelemetry API, which is supported by virtually all OpenTelemetry SDKs. As far as looking up the current span is concerned, the trace.getActiveSpan()
is available with the Lumigo OpenTelemetry Distro for JS version 1.8.0 and above. All versions of the Lumigo OpenTelemetry Distro for Python offer the opentelemetry.trace.get_current_span
API.
Further reading
* Execution tags documentation page