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

[chore] [receiver/datadog] Add support for v1 series #33957

Merged
merged 11 commits into from
Jul 17, 2024

Conversation

carrieedwards
Copy link
Contributor

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.

@carrieedwards carrieedwards requested a review from a team July 9, 2024 00:23
Copy link

linux-foundation-easycla bot commented Jul 9, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

receiver/datadogreceiver/batcher.go Outdated Show resolved Hide resolved
receiver/datadogreceiver/batcher.go Outdated Show resolved Hide resolved
receiver/datadogreceiver/metrics_translator.go Outdated Show resolved Hide resolved
receiver/datadogreceiver/metrics_translator.go Outdated Show resolved Hide resolved
metric.Sum().SetAggregationTemporality(pmetric.AggregationTemporalityDelta)
dps = metric.Sum().DataPoints()
default:
// Type is unset/unspecified
Copy link
Member

Choose a reason for hiding this comment

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

lets record the dp type as a counter (count/gauge/rate/unknown). can be done in a later pr

Copy link
Contributor

Choose a reason for hiding this comment

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

Are you talking about the entire switch case? I believe its better if metrics are properly identified from the start.

Copy link
Member

Choose a reason for hiding this comment

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

oh I meant it would be nice to have this receiver itself export a metric like otelcol_datadog_series_total{type="count|gauge|rate|undefined"}

receiver/datadogreceiver/metrics_translator.go Outdated Show resolved Hide resolved
Comment on lines 110 to 113
ts, ok := mt.streamHasTimestamp(stream)
if ok {
dp.SetStartTimestamp(ts)
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
ts, ok := mt.streamHasTimestamp(stream)
if ok {
dp.SetStartTimestamp(ts)
}
if ts, ok := mt.streamHasTimestamp(stream); ok {
dp.SetStartTimestamp(ts)
}

@carrieedwards carrieedwards force-pushed the cedwards/datadog-v1-metrics branch from 3dc9516 to e9b6ca8 Compare July 9, 2024 19:53
@carrieedwards carrieedwards changed the title [receiver/datadog] Add support for v1 series [chore] [receiver/datadog] Add support for v1 series Jul 10, 2024
"github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics/identity"
)

type Batcher struct {
Copy link
Member

Choose a reason for hiding this comment

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

this should probably be inside an internal package, otherwise it's part of this component's public API. Unless you meant to expose this to external consumers?

// Dimensions stores the properties of the series that are needed in order
// to unique identify the series. This is needed in order to batch metrics by
// resource, scope, and datapoint attributes
type Dimensions struct {
Copy link
Member

Choose a reason for hiding this comment

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

Same here

}

w.WriteHeader(http.StatusAccepted)
_, err = w.Write([]byte("OK"))
Copy link
Member

Choose a reason for hiding this comment

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

this err should probably be ignored (_)

@carrieedwards carrieedwards force-pushed the cedwards/datadog-v1-metrics branch from ca3008c to 0637b87 Compare July 15, 2024 16:49
@carrieedwards carrieedwards force-pushed the cedwards/datadog-v1-metrics branch from 0637b87 to bb6240c Compare July 17, 2024 14:46
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.

@jesusvazquez shared in private that they are committing to moving the items that would be part of the public API into an internal package. I think it's fine, especially if this happens within the next two weeks, which is when the next Collector should be released.

@jpkrohling jpkrohling merged commit f3fdea3 into open-telemetry:main Jul 17, 2024
154 checks passed
@github-actions github-actions bot added this to the next release milestone Jul 17, 2024
jpkrohling pushed a commit that referenced this pull request Jul 19, 2024
…ackage (#34160)

**Description:**
This PR is a follow-up to #33957. It refactors the Datadog receiver
files to remove internal methods and structures from the public API and
into an internal directory.

**Link to tracking Issue:** 
#18278 

**Testing:** 
This is a refactor, so no new unit tests have been added.
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 <[email protected]>
Co-authored-by: Carrie Edwards <[email protected]>
Co-authored-by: Juraci Paixão Kröhling <[email protected]>
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 <[email protected]>
Signed-off-by: György Krajcsovits <[email protected]>
Co-authored-by: Federico Torres <[email protected]>
Co-authored-by: György Krajcsovits <[email protected]>
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 <[email protected]>
Co-authored-by: Carrie Edwards <[email protected]>
Co-authored-by: Juraci Paixão Kröhling <[email protected]>
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 <[email protected]>
Signed-off-by: György Krajcsovits <[email protected]>
Co-authored-by: Federico Torres <[email protected]>
Co-authored-by: György Krajcsovits <[email protected]>
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 <[email protected]>
Co-authored-by: Carrie Edwards <[email protected]>
Co-authored-by: Juraci Paixão Kröhling <[email protected]>
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 <[email protected]>
Signed-off-by: György Krajcsovits <[email protected]>
Co-authored-by: Federico Torres <[email protected]>
Co-authored-by: György Krajcsovits <[email protected]>
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.

6 participants