Skip to content

Commit 9549eb2

Browse files
committed
add baseURL config
1 parent 68e1d6c commit 9549eb2

File tree

81 files changed

+1278
-289
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+1278
-289
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: 'enhancement'
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: azureblobexporter
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: change to alpha for azure blob exporter
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [39272]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: [user]
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: enhancement
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: elasticsearchexporter
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Add `telemetry::log_failed_docs_input` and `telemetry::log_failed_docs_input_rate_limit` config to facilitate debugging of failed bulk request items
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [39205]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext: Additionally, log a warning about potentially exposing sensitive data on any enabled `telemetry` config.
19+
20+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: [user]
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: deprecation
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: kafkareceiver
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Add signal-specific topic and encoding config, deprecate existing topic/encoding config.
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [32735]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: [user]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
change_type: enhancement
2+
3+
component: k8sattributesprocessor
4+
5+
note: Add option to configure automatic resource attributes - with annotation prefix
6+
7+
issues: [37114]
8+
9+
subtext: |
10+
Implements [Specify resource attributes using Kubernetes annotations](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/non-normative/k8s-attributes.md#specify-resource-attributes-using-kubernetes-annotations).
11+
12+
If you are using the file log receiver, you can now create the same resource attributes as traces (via OTLP) received
13+
from an application instrumented with the OpenTelemetry Operator -
14+
simply by adding the `extract: { otel_annotations: true }` configuration to the `k8sattributesprocessor` processor.
15+
See the [documentation](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/k8sattributesprocessor/README.md#config-example) for more details.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: enhancement
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: signaltometricsconnector
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Allow to configure `optional` attributes which are copied as-is to the output metric.
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [38600]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: [user]
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: bug_fix
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: splunkenterprisereceiver
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Fixes `otelcol_scraper_errored_metric_points` metric, which was not incrementing properly
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [38691]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: []

cmd/opampsupervisor/supervisor/supervisor_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package supervisor
66
import (
77
"bytes"
88
"context"
9+
"errors"
910
"fmt"
1011
"net"
1112
"os"
@@ -598,7 +599,7 @@ service:
598599
},
599600
rcs,
600601
)
601-
return fmt.Errorf("unexpected error")
602+
return errors.New("unexpected error")
602603
},
603604
updateEffectiveConfigFunc: func(_ context.Context) error {
604605
return nil
@@ -853,7 +854,7 @@ func Test_handleAgentOpAMPMessage(t *testing.T) {
853854
mc := &mockOpAMPClient{
854855
updateEffectiveConfigFunc: func(_ context.Context) error {
855856
updatedClientEffectiveConfig = true
856-
return fmt.Errorf("unexpected error")
857+
return errors.New("unexpected error")
857858
},
858859
}
859860

cmd/telemetrygen/internal/common/config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
package common
55

66
import (
7-
"fmt"
7+
"errors"
88
"strconv"
99
"strings"
1010
"time"
@@ -15,8 +15,8 @@ import (
1515
)
1616

1717
var (
18-
errFormatOTLPAttributes = fmt.Errorf("value should be in one of the following formats: key=\"value\", key=true, key=false, or key=<integer>")
19-
errDoubleQuotesOTLPAttributes = fmt.Errorf("value should be a string wrapped in double quotes")
18+
errFormatOTLPAttributes = errors.New("value should be in one of the following formats: key=\"value\", key=true, key=false, or key=<integer>")
19+
errDoubleQuotesOTLPAttributes = errors.New("value should be a string wrapped in double quotes")
2020
)
2121

2222
const (

cmd/telemetrygen/internal/common/validate.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ package common
55

66
import (
77
"encoding/hex"
8-
"fmt"
8+
"errors"
99
)
1010

1111
var (
12-
errInvalidTraceIDLength = fmt.Errorf("TraceID must be a 32 character hex string, like: 'ae87dadd90e9935a4bc9660628efd569'")
13-
errInvalidSpanIDLength = fmt.Errorf("SpanID must be a 16 character hex string, like: '5828fa4960140870'")
14-
errInvalidTraceID = fmt.Errorf("failed to create traceID byte array from the given traceID, make sure the traceID is a hex representation of a [16]byte, like: 'ae87dadd90e9935a4bc9660628efd569'")
15-
errInvalidSpanID = fmt.Errorf("failed to create SpanID byte array from the given SpanID, make sure the SpanID is a hex representation of a [8]byte, like: '5828fa4960140870'")
12+
errInvalidTraceIDLength = errors.New("TraceID must be a 32 character hex string, like: 'ae87dadd90e9935a4bc9660628efd569'")
13+
errInvalidSpanIDLength = errors.New("SpanID must be a 16 character hex string, like: '5828fa4960140870'")
14+
errInvalidTraceID = errors.New("failed to create traceID byte array from the given traceID, make sure the traceID is a hex representation of a [16]byte, like: 'ae87dadd90e9935a4bc9660628efd569'")
15+
errInvalidSpanID = errors.New("failed to create SpanID byte array from the given SpanID, make sure the SpanID is a hex representation of a [8]byte, like: '5828fa4960140870'")
1616
)
1717

1818
func ValidateTraceID(traceID string) error {

cmd/telemetrygen/pkg/logs/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
package logs
55

66
import (
7-
"fmt"
7+
"errors"
88

99
"github.com/spf13/pflag"
1010

@@ -59,7 +59,7 @@ func (c *Config) SetDefaults() {
5959
// Validate validates the test scenario parameters.
6060
func (c *Config) Validate() error {
6161
if c.TotalDuration <= 0 && c.NumLogs <= 0 {
62-
return fmt.Errorf("either `logs` or `duration` must be greater than 0")
62+
return errors.New("either `logs` or `duration` must be greater than 0")
6363
}
6464

6565
if c.TraceID != "" {

cmd/telemetrygen/pkg/logs/logs.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package logs
55

66
import (
77
"context"
8+
"errors"
89
"fmt"
910
"sync"
1011
"sync/atomic"
@@ -147,7 +148,7 @@ func createExporter(cfg *Config, logger *zap.Logger) (sdklog.Exporter, error) {
147148
func parseSeverity(severityText string, severityNumber int32) (string, log.Severity, error) {
148149
sn := log.Severity(severityNumber)
149150
if sn < log.SeverityTrace1 || sn > log.SeverityFatal4 {
150-
return "", log.SeverityUndefined, fmt.Errorf("severity-number is out of range, the valid range is [1,24]")
151+
return "", log.SeverityUndefined, errors.New("severity-number is out of range, the valid range is [1,24]")
151152
}
152153

153154
// severity number should match well-known severityText

cmd/telemetrygen/pkg/metrics/aggregation_temporality.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
package metrics
55

66
import (
7-
"fmt"
7+
"errors"
88

99
"go.opentelemetry.io/otel/sdk/metric/metricdata"
1010
)
@@ -20,7 +20,7 @@ func (t *AggregationTemporality) Set(v string) error {
2020
*t = AggregationTemporality(metricdata.CumulativeTemporality)
2121
return nil
2222
default:
23-
return fmt.Errorf(`temporality must be one of "delta" or "cumulative"`)
23+
return errors.New(`temporality must be one of "delta" or "cumulative"`)
2424
}
2525
}
2626

cmd/telemetrygen/pkg/metrics/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
package metrics
55

66
import (
7-
"fmt"
7+
"errors"
88

99
"github.com/spf13/pflag"
1010
"go.opentelemetry.io/otel/sdk/metric/metricdata"
@@ -66,7 +66,7 @@ func (c *Config) SetDefaults() {
6666
// Validate validates the test scenario parameters.
6767
func (c *Config) Validate() error {
6868
if c.TotalDuration <= 0 && c.NumMetrics <= 0 {
69-
return fmt.Errorf("either `metrics` or `duration` must be greater than 0")
69+
return errors.New("either `metrics` or `duration` must be greater than 0")
7070
}
7171

7272
if c.TraceID != "" {

cmd/telemetrygen/pkg/traces/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
package traces
55

66
import (
7-
"fmt"
7+
"errors"
88
"time"
99

1010
"github.com/spf13/pflag"
@@ -64,7 +64,7 @@ func (c *Config) SetDefaults() {
6464
// Validate validates the test scenario parameters.
6565
func (c *Config) Validate() error {
6666
if c.TotalDuration <= 0 && c.NumTraces <= 0 {
67-
return fmt.Errorf("either `traces` or `duration` must be greater than 0")
67+
return errors.New("either `traces` or `duration` must be greater than 0")
6868
}
6969
return nil
7070
}

connector/signaltometricsconnector/README.md

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,38 @@ attributes:
146146
- key: datapoint.foo
147147
- key: datapoint.bar
148148
default_value: bar
149+
- key: datapoint.baz
150+
optional: true
149151
```
150152

151153
If attributes are specified then a separate metric will be generated for each unique
152-
set of attribute values. Optionally, a `default_value` can be used to always include
153-
the attribute with the value of the attribute defaulting to the value specified in
154-
`default_value` if the incoming data is missing that attribute.
154+
set of attribute values. There are three behaviors that can be configured for an
155+
attribute:
156+
157+
- Without any extra parameters: `datapoint.foo` in the above yaml is an example
158+
of such configuration. In this configuration, only the signals which have the said
159+
attribute are processed with the attribute's value as one of the attributes for
160+
the output metric. If the attribute is missing then the signal is not processed.
161+
- With `default_value`: `datapoint.bar` in the above yaml is an example of such
162+
configuration. In this configuration all the signals are processed irrespective
163+
of the attribute being present or not in the input signal. The output metric
164+
is categorized as per the incoming value of the attribute and an extra bucket
165+
exists with the attribute set to the configured default value for all the signals
166+
that were missing the configured attribute.
167+
- With `optional` set to `true`: `datapoint.baz` in the above yaml is an example
168+
of such configuration. If the attribute is configured with `optional` and present
169+
in the incoming signal then it will be added directly to the output metric. If
170+
it is absent then a new metric with missing attributes will be created. In addition,
171+
the `optional` attribute will not impact the decision i.e. even if the `optional`
172+
attributes are not present in the incoming signal, the signal will be processed
173+
and will produce a metric given all other non-optional attributes are present
174+
or have a default value defined.
175+
176+
Note that resource attributes are handled differently, check the resource attributes
177+
section for more details on this. Think of `attributes` as conditional filters for
178+
choosing which attributes should be included in the output metric whereas
179+
`include_resource_attributes` is an include list for customizing resource attributes
180+
of the output metric.
155181

156182
### Conditions
157183

@@ -201,16 +227,23 @@ include_resource_attributes:
201227
- key: resource.foo # Include resource.foo attribute if present
202228
- key: resource.bar # Always include resource.bar attribute, default to bar
203229
default_value: bar
230+
- key: resource.baz # Optional resource.baz attribute is added if present
231+
optional: true
204232
```
205233

206-
With the above configuration the produced metrics would only have the couple of
207-
resource attributes specified in the list:
234+
With the above configuration the produced metrics would have the following
235+
resource attributes:
208236

209237
- `resource.foo` will be present for the produced metrics if the incoming data also
210-
has the attribute defined.
238+
has the attribute defined. If the attribute is missing in the incoming data the
239+
output metric will be produced without the said attribute.
211240
- `resource.bar` will always be present because of the `default_value`. If the incoming
212241
data does not have a resource attribute with name `resource.bar` then the configured
213242
`default_value` of `bar` will be used.
243+
- `resource.baz` will behave exactly same as `resource.foo`. Since resource attributes
244+
are basically an include list, the `optional` option is a no-op i.e. the resource
245+
attributes with `optional` set to `true` behaves identical to an attribute configured
246+
without `default_value` or `optional`.
214247

215248
### Single writer
216249

connector/signaltometricsconnector/config/config.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ func (c *Config) Unmarshal(collectorCfg *confmap.Conf) error {
123123

124124
type Attribute struct {
125125
Key string `mapstructure:"key"`
126+
Optional bool `mapstructure:"optional"`
126127
DefaultValue any `mapstructure:"default_value"`
127128
}
128129

@@ -185,6 +186,9 @@ func (mi *MetricInfo) validateAttributes() error {
185186
if attr.Key == "" {
186187
return fmt.Errorf("attribute key missing")
187188
}
189+
if attr.DefaultValue != nil && attr.Optional {
190+
return errors.New("only one of default_value or optional should be set")
191+
}
188192
if _, ok := duplicate[attr.Key]; ok {
189193
return fmt.Errorf("duplicate key found in attributes config: %s", attr.Key)
190194
}

0 commit comments

Comments
 (0)