-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
base: main
Are you sure you want to change the base?
[receiver/datadog] Add initial support for metrics #33631
Conversation
Holding off on rebasing until the after the release |
There was a problem hiding this 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) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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.
eb69c19
to
7f2e37e
Compare
a005ecc
to
f73d2c9
Compare
There was a problem hiding this 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) { |
There was a problem hiding this comment.
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
?
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/datadogreceiverLink 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