Cees Bos

My gists about Observability

Observability enthusiast and Grafana Champion, always looking for ways to improve software with better observability and what new insights can be gained. Delivering reliable software is always my priority. Combining existing tools often results in new ways to get an even better view. I work for OpenValue as a software engineer and SRE.
    @github @mastodon @rss Grafana Champions information

    Adding deployment.environment to Grafana Faro traces

    One of the great things about OpenTelemetry is the standardisation of span attributes and resource attributes.
    An example of this is deployment.environment.

    AttributeTypeDescriptionExamplesRequirement Level
    deployment.environmentstringName of the deployment environment (aka deployment tier).staging; productionRecommended

    Source: https://opentelemetry.io/docs/specs/semconv/resource/deployment-environment/

    With Grafana Faro you can configure the environment, as I explained in my blog post about the setup of Grafana Faro. This adds environment to the setup. In my technical deep dive blog post I explained that the data is sent as logs and as traces. The logs include the environment attribute which you can find that as app_environment attribute. But the information is not available in the traces stored in Tempo.

    Adding deployment.environment to traces

    It is very easy to add deployment.environment to traces as well.

    webTracingScript.onload = () => {
        window.GrafanaFaroWebSdk.faro.instrumentations.add(
            new window.GrafanaFaroWebTracing.TracingInstrumentation({
                resourceAttributes: {
                    "deployment.environment": "production"
                }
            })
        );
    };
    

    That is what I added to the Hugo Faro Analytics module:
    https://github.com/cbos/hugo-faro-analytics/commit/d4aeb1f973d4d38864d580bf32086ac1508d9506

    Git commit

    This is the result:

    traces with deployment environment

    trace details

    Span metrics per environment

    With this as a result, you can create dashboards where you can distinguish between the different environments. And if you use span metrics, it is possible to split the metrics of the environments with the dimensions configuration.


    [ Update Januari 8th 21:30 CET ]
    I created a pull request to make it part of the Faro Web SDK https://github.com/grafana/faro-web-sdk/pull/453

    [ Update Januari 10th 11:45 CET ]
    PR has been approved and merged and will be default from the next release onward.

    propulsed by hugo and hugo-theme-gists