-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[receiver/datadog] Implement '/info' endpoint (#34772)
**Description:** <Describe what has changed.> The Datadog agent exposes a `/info` [endpoint](https://github.com/DataDog/datadog-agent/blob/ab888632bb71bcd57716e3428ed4c242ed7b9aaa/pkg/trace/api/api.go#L205), communicating its available endpoints and capabilities. This endpoint is used for the [trace libraries](https://github.com/DataDog/dd-trace-java/blob/master/communication/src/main/java/datadog/communication/ddagent/DDAgentFeaturesDiscovery.java#L140-L173) to infer the features available in the queried agent, and make some decisions about the telemetry data at hand, including whether to send [client stats](https://github.com/DataDog/dd-trace-java/blob/master/communication/src/main/java/datadog/communication/ddagent/DDAgentFeaturesDiscovery.java#L40) for the [local sampled spans](https://github.com/DataDog/dd-trace-java/blob/master/dd-trace-core/src/main/java/datadog/trace/core/CoreTracer.java#L993-L1008) used to calculate the [trace metrics](https://docs.datadoghq.com/tracing/metrics/metrics_namespace/). PS: in order to dynamically expose the available endpoints, this PR also does a minor refactor on the endpoint configuration structure, defining them in a `[]Endpoint` rather than registering them directly in the `ServeMux`. **Link to tracking Issue:** **Testing:** **Documentation:** --------- Signed-off-by: Juraci Paixão Kröhling <[email protected]> Co-authored-by: Juraci Paixão Kröhling <[email protected]>
- Loading branch information
1 parent
4bac647
commit 8477a83
Showing
8 changed files
with
403 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Use this changelog template to create an entry for release notes. | ||
|
||
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
change_type: enhancement | ||
|
||
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) | ||
component: datadogreceiver | ||
|
||
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
note: Implement '/info' endpoint | ||
|
||
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. | ||
issues: [34772] | ||
|
||
# (Optional) One or more lines of additional information to render under the primary note. | ||
# These lines will be padded with 2 spaces and then inserted directly into the document. | ||
# Use pipe (|) for multiline entries. | ||
subtext: | ||
|
||
# If your change doesn't affect end users or the exported elements of any package, | ||
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. | ||
# Optional: The change log or logs in which this entry should be included. | ||
# e.g. '[user]' or '[user, api]' | ||
# Include 'user' if the change is relevant to end users. | ||
# Include 'api' if there is a change to a library API. | ||
# Default: '[user]' | ||
change_logs: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Copyright The OpenTelemetry Authors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package translator // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/datadogreceiver/internal/translator" | ||
|
||
import ( | ||
"github.com/DataDog/datadog-agent/pkg/obfuscate" | ||
) | ||
|
||
type ReducedObfuscationConfig struct { | ||
ElasticSearch bool `json:"elastic_search"` | ||
Mongo bool `json:"mongo"` | ||
SQLExecPlan bool `json:"sql_exec_plan"` | ||
SQLExecPlanNormalize bool `json:"sql_exec_plan_normalize"` | ||
HTTP obfuscate.HTTPConfig `json:"http"` | ||
RemoveStackTraces bool `json:"remove_stack_traces"` | ||
Redis obfuscate.RedisConfig `json:"redis"` | ||
Memcached obfuscate.MemcachedConfig `json:"memcached"` | ||
} | ||
|
||
type ReducedConfig struct { | ||
DefaultEnv string `json:"default_env"` | ||
TargetTPS float64 `json:"target_tps"` | ||
MaxEPS float64 `json:"max_eps"` | ||
ReceiverPort int `json:"receiver_port"` | ||
ReceiverSocket string `json:"receiver_socket"` | ||
ConnectionLimit int `json:"connection_limit"` | ||
ReceiverTimeout int `json:"receiver_timeout"` | ||
MaxRequestBytes int64 `json:"max_request_bytes"` | ||
StatsdPort int `json:"statsd_port"` | ||
MaxMemory float64 `json:"max_memory"` | ||
MaxCPU float64 `json:"max_cpu"` | ||
AnalyzedSpansByService map[string]map[string]float64 `json:"analyzed_spans_by_service"` | ||
Obfuscation ReducedObfuscationConfig `json:"obfuscation"` | ||
} | ||
|
||
type DDInfo struct { | ||
Version string `json:"version"` | ||
Endpoints []string `json:"endpoints"` | ||
ClientDropP0s bool `json:"client_drop_p0s"` | ||
SpanMetaStructs bool `json:"span_meta_structs"` | ||
LongRunningSpans bool `json:"long_running_spans"` | ||
Config *ReducedConfig `json:"config"` | ||
} |
Oops, something went wrong.