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

Emit all OTel signals by default #609

Merged
merged 2 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions jobs/loggr-forwarder-agent/spec
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ properties:
example: {"deployment": "cf"}

emit_otel_traces:
description: "Whether to emit traces to OpenTelemetry Collector downstream consumers"
default: false
description: "Emit traces to downstream OpenTelemetry consumers"
default: true

emit_otel_metrics:
description: "Whether to emit metrics to OpenTelemetry Collector downstream consumers"
description: "Emit metrics to downstream OpenTelemetry consumers"
default: true

emit_otel_logs:
description: "Whether to emit logs to OpenTelemetry Collector downstream consumers"
default: false
description: "Emit logs to downstream OpenTelemetry consumers"
default: true

tls.ca_cert:
description: |
Expand Down
16 changes: 8 additions & 8 deletions src/pkg/otelcolclient/otelcolclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ func (c *Client) writeLog(e *loggregator_v2.Envelope) {
{
LogRecords: []*logspb.LogRecord{
{
TimeUnixNano: uint64(e.GetTimestamp()),
TimeUnixNano: uint64(e.GetTimestamp()), // nolint:gosec
Attributes: atts,
ObservedTimeUnixNano: uint64(time.Now().UnixNano()),
ObservedTimeUnixNano: uint64(time.Now().UnixNano()), // nolint:gosec
SeverityText: svrtyNumber.String(),
SeverityNumber: svrtyNumber,
Body: &commonpb.AnyValue{
Expand All @@ -199,9 +199,9 @@ func (c *Client) writeEvent(e *loggregator_v2.Envelope) {
{
LogRecords: []*logspb.LogRecord{
{
TimeUnixNano: uint64(e.GetTimestamp()),
TimeUnixNano: uint64(e.GetTimestamp()), // nolint:gosec
Attributes: atts,
ObservedTimeUnixNano: uint64(time.Now().UnixNano()),
ObservedTimeUnixNano: uint64(time.Now().UnixNano()), // nolint:gosec
Body: &commonpb.AnyValue{
Value: &commonpb.AnyValue_KvlistValue{
KvlistValue: &commonpb.KeyValueList{
Expand Down Expand Up @@ -239,7 +239,7 @@ func (c *Client) writeCounter(e *loggregator_v2.Envelope) {
IsMonotonic: e.GetCounter().GetDelta() == 0,
DataPoints: []*metricspb.NumberDataPoint{
{
TimeUnixNano: uint64(e.GetTimestamp()),
TimeUnixNano: uint64(e.GetTimestamp()), // nolint:gosec
Attributes: atts,
Value: &metricspb.NumberDataPoint_AsInt{
AsInt: int64(e.GetCounter().GetTotal() << 1 >> 1), //#nosec G115
Expand All @@ -266,7 +266,7 @@ func (c *Client) writeGauge(e *loggregator_v2.Envelope) {
Gauge: &metricspb.Gauge{
DataPoints: []*metricspb.NumberDataPoint{
{
TimeUnixNano: uint64(e.GetTimestamp()),
TimeUnixNano: uint64(e.GetTimestamp()), // nolint:gosec
Attributes: atts,
Value: &metricspb.NumberDataPoint_AsDouble{
AsDouble: v.GetValue(),
Expand Down Expand Up @@ -320,8 +320,8 @@ func (c *Client) writeTimer(e *loggregator_v2.Envelope) {
SpanId: spanId,
Name: name,
Kind: kind,
StartTimeUnixNano: uint64(e.GetTimer().GetStart()),
EndTimeUnixNano: uint64(e.GetTimer().GetStop()),
StartTimeUnixNano: uint64(e.GetTimer().GetStart()), // nolint:gosec
EndTimeUnixNano: uint64(e.GetTimer().GetStop()), // nolint:gosec
Status: &tracepb.Status{
Code: tracepb.Status_STATUS_CODE_UNSET,
},
Expand Down
Loading