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

Merged

Conversation

carrieedwards
Copy link
Contributor

@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
Contributor 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?

Copy link
Member

Choose a reason for hiding this comment

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

That too, but what I had in mind was splitting the handlers themselves into separate files, keeping only references to them on the receiver code.

receiver/datadogreceiver/httpmetrics.go Outdated Show resolved Hide resolved
@carrieedwards carrieedwards force-pushed the cedwards/datadog-metrics-receiver branch 2 times, most recently 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?

@carrieedwards carrieedwards force-pushed the cedwards/datadog-metrics-receiver branch from c7dc27e to fbf713a Compare July 2, 2024 18:24
@jpkrohling jpkrohling merged commit ab4d726 into open-telemetry:main Jul 3, 2024
154 checks passed
@github-actions github-actions bot added this to the next release milestone Jul 3, 2024
jpkrohling pushed a commit that referenced this pull request Jul 8, 2024
**Description**:
This PR is a follow up to the former
#33631
extending the existing tags translation structure. This will be required
for the follow up PRs adding 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.

**Notes**:
- Adding `[chore]` to the title of the PR because
https://github.com/grafana/opentelemetry-collector-contrib/blob/ab4d726aaaa07aad702ff3b312a8e261f2b38021/.chloggen/datadogreceiver_metrics.yaml#L1-L27
already exists.

---------

Signed-off-by: Jesus Vazquez <jesus.vazquez@grafana.com>
jpkrohling pushed a commit that referenced this pull request Jul 17, 2024
**Description:**
This PR adds support for V1 series, as well as batches the metrics by
resource, scope, and datapoint attributes. The batching code will also
be required for future PRs which will add support for v2 series
endpoints, service checks, and sketches.

Follow up of #33631 and #33922.

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, as well as an end-to-end test, have been added.

---------

Co-authored-by: Federico Torres <federico.sa.torres@gmail.com>
jpkrohling pushed a commit that referenced this pull request Aug 13, 2024
**Description:**
This PR adds support for Datadog V2 series.

Follow up of #33631 and #33957.

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, as well as an end-to-end test, have been added.
jpkrohling added a commit that referenced this pull request Sep 9, 2024
Description:
This PR adds support for Datadog Service Checks.

Follow up of
#33631
,
#33957
and
#34180.

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, as well as an end-to-end test, have been added.

---------

Signed-off-by: alexgreenbank <alex.greenbank@grafana.com>
Co-authored-by: Carrie Edwards <edwrdscarrie@gmail.com>
Co-authored-by: Juraci Paixão Kröhling <juraci@kroehling.de>
jpkrohling pushed a commit that referenced this pull request Sep 9, 2024
**Description:**
This PR adds support for translating Datadog sketches into Exponential
Histograms.

Follow up of #33631, #33957 and #34180.

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, as well as an end-to-end test, have been added.

---------

Signed-off-by: Federico Torres <federico.torres@grafana.com>
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Co-authored-by: Federico Torres <federico.sa.torres@gmail.com>
Co-authored-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
f7o pushed a commit to f7o/opentelemetry-collector-contrib that referenced this pull request Sep 12, 2024
…34180)

**Description:**
This PR adds support for Datadog V2 series.

Follow up of open-telemetry#33631 and open-telemetry#33957.

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:** 
open-telemetry#18278 

**Testing:** 
Unit tests, as well as an end-to-end test, have been added.
f7o pushed a commit to f7o/opentelemetry-collector-contrib that referenced this pull request Sep 12, 2024
…etry#34474)

Description:
This PR adds support for Datadog Service Checks.

Follow up of
open-telemetry#33631
,
open-telemetry#33957
and
open-telemetry#34180.

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:

open-telemetry#18278

Testing:
Unit tests, as well as an end-to-end test, have been added.

---------

Signed-off-by: alexgreenbank <alex.greenbank@grafana.com>
Co-authored-by: Carrie Edwards <edwrdscarrie@gmail.com>
Co-authored-by: Juraci Paixão Kröhling <juraci@kroehling.de>
f7o pushed a commit to f7o/opentelemetry-collector-contrib that referenced this pull request Sep 12, 2024
**Description:**
This PR adds support for translating Datadog sketches into Exponential
Histograms.

Follow up of open-telemetry#33631, open-telemetry#33957 and open-telemetry#34180.

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:** 
open-telemetry#18278 

**Testing:** 
Unit tests, as well as an end-to-end test, have been added.

---------

Signed-off-by: Federico Torres <federico.torres@grafana.com>
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Co-authored-by: Federico Torres <federico.sa.torres@gmail.com>
Co-authored-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
jriguera pushed a commit to springernature/opentelemetry-collector-contrib that referenced this pull request Oct 4, 2024
…etry#34474)

Description:
This PR adds support for Datadog Service Checks.

Follow up of
open-telemetry#33631
,
open-telemetry#33957
and
open-telemetry#34180.

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:

open-telemetry#18278

Testing:
Unit tests, as well as an end-to-end test, have been added.

---------

Signed-off-by: alexgreenbank <alex.greenbank@grafana.com>
Co-authored-by: Carrie Edwards <edwrdscarrie@gmail.com>
Co-authored-by: Juraci Paixão Kröhling <juraci@kroehling.de>
jriguera pushed a commit to springernature/opentelemetry-collector-contrib that referenced this pull request Oct 4, 2024
**Description:**
This PR adds support for translating Datadog sketches into Exponential
Histograms.

Follow up of open-telemetry#33631, open-telemetry#33957 and open-telemetry#34180.

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:** 
open-telemetry#18278 

**Testing:** 
Unit tests, as well as an end-to-end test, have been added.

---------

Signed-off-by: Federico Torres <federico.torres@grafana.com>
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Co-authored-by: Federico Torres <federico.sa.torres@gmail.com>
Co-authored-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
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.

4 participants