#opentelemetry #tracing #cloudflare #worker #datadog

opentelemetry-datadog-cloudflare

Datadog exporters and propagators for OpenTelemetry for Cloudflare workers

8 releases (5 breaking)

Uses new Rust 2021

0.6.0 Sep 1, 2022
0.5.0 Aug 3, 2022
0.4.1 Jul 20, 2022
0.3.0 Jul 19, 2022
0.1.12 Jul 19, 2022

#190 in Debugging

Download history 399/week @ 2022-07-16 391/week @ 2022-07-23 1029/week @ 2022-07-30 1140/week @ 2022-08-06 439/week @ 2022-08-13 1772/week @ 2022-08-20 1251/week @ 2022-08-27 471/week @ 2022-09-03 370/week @ 2022-09-10 245/week @ 2022-09-17

2,972 downloads per month

Apache-2.0

36KB
687 lines

OpenTelemetry — An observability framework for cloud-native software.

OpenTelemetry Datadog Cloudflare

Overview

This crate provides additional propagators and exporters for sending telemetry data to Datadog directly without going through the Datadog-agent.

Based on opentelemetry-datadog.

Features

opentelemetry-datadog-cloudflare supports following features:

  • surf-client: use surf http client to send spans.

lib.rs:

OpenTelemetry Datadog Exporter for Cloudflare

An OpenTelemetry datadog exporter implementation for Cloudflare

Quirks

There are currently some incompatibilities between Datadog and OpenTelemetry, and this manifests as minor quirks to this exporter.

Firstly Datadog uses operation_name to describe what OpenTracing would call a component. Or to put it another way, in OpenTracing the operation / span name's are relatively granular and might be used to identify a specific endpoint. In datadog, however, they are less granular - it is expected in Datadog that a service will have single primary span name that is the root of all traces within that service, with an additional piece of metadata called resource_name providing granularity. See here

The Datadog Golang API takes the approach of using a resource.name OpenTelemetry attribute to set the resource_name. See here

Unfortunately, this breaks compatibility with other OpenTelemetry exporters which expect a more granular operation name - as per the OpenTracing specification.

This exporter therefore takes a different approach of naming the span with the name of the tracing provider, and using the span name to set the resource_name. This should in most cases lead to the behaviour that users expect.

Datadog additionally has a span_type string that alters the rendering of the spans in the web UI. This can be set as the span.type OpenTelemetry span attribute.

For standard values see here

Bring your own http client

Users can choose appropriate http clients to align with their runtime.

Based on the feature enabled. The only client available is surf, feel free to implement other http clients.

Note that async http clients may need specific runtime otherwise it will panic. User should make sure the http client is running in appropriate runime.

Users can always use their own http clients by implementing HttpClient trait.

Dependencies

~13–24MB
~464K SLoC