Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[receiver/datadog] Add initial support for metrics #33631

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

carrieedwards
Copy link

@carrieedwards carrieedwards commented Jun 18, 2024

Description:
This PR adds the initial structure required to add support for metrics in the Datadog receiver. This is the first of several PRs which will add support for v1 and v2 series endpoints, service checks, as well as sketches.

The full version of the code can be found in the cedwards/datadog-metrics-receiver-full branch, or in Grafana Alloy: https://github.com/grafana/alloy/tree/main/internal/etc/datadogreceiver

Link to tracking Issue:
#18278

Testing:
Unit tests have been added. More thorough tests will be included in follow-up PRs as the remaining functionality is added.

Documentation:
Updated README

@carrieedwards
Copy link
Author

Holding off on rebasing until the after the release

Copy link
Member

@jpkrohling jpkrohling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great start, thank you! Let's wait until the release is done and see if we have further reviews until then.

@@ -109,3 +133,87 @@ func (ddr *datadogReceiver) handleTraces(w http.ResponseWriter, req *http.Reques
_, _ = w.Write([]byte("OK"))

}

// handleV1Series handles the v1 series endpoint https://docs.datadoghq.com/api/latest/metrics/#submit-metrics
func (ddr *datadogReceiver) handleV1Series(w http.ResponseWriter, req *http.Request) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps not for this PR, but it might be a good idea to split the handlers in their own source file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean something like metrics_receiver.go and traces_receiver.go?

semconv "go.opentelemetry.io/otel/semconv/v1.25.0"
)

func httpMetrics(meter metric.Meter, next http.Handler) http.Handler {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we might have a similar metric already being created for all HTTP servers already, perhaps shown only with the telemetry level is set to detailed. If not, we might want to use mdatagen to define the metric.

@carrieedwards carrieedwards force-pushed the cedwards/datadog-metrics-receiver branch from eb69c19 to 7f2e37e Compare June 20, 2024 15:38
@carrieedwards carrieedwards force-pushed the cedwards/datadog-metrics-receiver branch from a005ecc to f73d2c9 Compare June 20, 2024 16:22
Copy link
Contributor

@MovieStoreGuy MovieStoreGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a great start.

@@ -109,3 +133,87 @@ func (ddr *datadogReceiver) handleTraces(w http.ResponseWriter, req *http.Reques
_, _ = w.Write([]byte("OK"))

}

// handleV1Series handles the v1 series endpoint https://docs.datadoghq.com/api/latest/metrics/#submit-metrics
func (ddr *datadogReceiver) handleV1Series(w http.ResponseWriter, req *http.Request) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean something like metrics_receiver.go and traces_receiver.go?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants