-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add logs agent pipeline performance telemetry #30744
Changes from 12 commits
0cea77d
185ea96
a19dbb0
a0c07a0
22d27a6
7201bae
fa2cba8
5fc6dbf
f9454d7
b7e1c64
899c878
d9929e8
5033c78
b894b8f
f015f35
b1dd831
6e27f61
5c2e611
2b953cc
66dc166
beaf565
815ad2a
7f57f8c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// Unless explicitly stated otherwise all files in this repository are licensed | ||
// under the Apache License Version 2.0. | ||
// This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
// Copyright 2016-present Datadog, Inc. | ||
|
||
//nolint:revive // TODO(AML) Fix revive linter | ||
package client | ||
|
||
import ( | ||
"fmt" | ||
) | ||
|
||
// DestinationMetadata contains metadata about a destination | ||
type DestinationMetadata struct { | ||
componentName string | ||
instanceID string | ||
kind string | ||
endpointId string | ||
ReportingEnabled bool | ||
} | ||
|
||
// NewDestinationMetadata returns a new DestinationMetadata | ||
func NewDestinationMetadata(componentName, instanceID, kind, endpointId string) *DestinationMetadata { | ||
return &DestinationMetadata{ | ||
componentName: componentName, | ||
instanceID: instanceID, | ||
kind: kind, | ||
endpointId: endpointId, | ||
ReportingEnabled: true, | ||
} | ||
} | ||
|
||
// NewNoopDestinationMetadata returns a new DestinationMetadata with reporting disabled | ||
func NewNoopDestinationMetadata() *DestinationMetadata { | ||
return &DestinationMetadata{ | ||
ReportingEnabled: false, | ||
} | ||
} | ||
|
||
// TelemetryName returns the telemetry name for the destination | ||
func (d *DestinationMetadata) TelemetryName() string { | ||
if !d.ReportingEnabled { | ||
return "" | ||
} | ||
return fmt.Sprintf("%s_%s_%s_%s", d.componentName, d.instanceID, d.kind, d.endpointId) | ||
} | ||
|
||
// MonitorTag returns the monitor tag for the destination | ||
func (d *DestinationMetadata) MonitorTag() string { | ||
if !d.ReportingEnabled { | ||
return "" | ||
} | ||
return fmt.Sprintf("destination_%s_%s", d.kind, d.endpointId) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
Ideally we should provide the config component as part of
New
function, so we do not use thepkgconfigsetup.Datadog()
global 😄Maybe something we could do on a separate PR