Skip to content

Commit

Permalink
Merge branch 'main' into add-metrics-to-telemetrygen
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelbirkner committed Sep 14, 2023
2 parents 2685e6b + ec3f9bf commit a88abc8
Show file tree
Hide file tree
Showing 151 changed files with 2,514 additions and 604 deletions.
27 changes: 27 additions & 0 deletions .chloggen/ottl-structtag-cleanup.yaml
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: breaking

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: pkg/ottl

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Remove support for `ottlarg`. The struct's field order is now the function parameter order.

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [25705]

# (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: [api]
30 changes: 30 additions & 0 deletions .chloggen/pkg-stanza-extract-trim-split.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: pkg/stanza

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Make trim func composable

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [26536]

# (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: |
- Adds trim.WithFunc to allow trim funcs to wrap bufio.SplitFuncs.
- Removes trim.Func from split.Config.Func. Use trim.WithFunc instead.
- Removes trim.Func from flush.WithPeriod. Use trim.WithFunc instead.
# 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: [api]
27 changes: 27 additions & 0 deletions .chloggen/redisreceiver_cmd_latency.yaml
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: redisreceiver

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Added `redis.cmd.latency` metric.

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [6942]

# (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: [user]
20 changes: 20 additions & 0 deletions .chloggen/splunkent-client.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Use this changelog template to create an entry for release notes.
# If your change doesn't affect end users, such as a test fix or a tooling change,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.

# 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: splunkentreceiver

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: "adding component logic to splunkenterprise receiver"

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [12667]

# (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:
1 change: 0 additions & 1 deletion cmd/checkapi/allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ exporter/sentryexporter
exporter/sumologicexporter
extension/observer/ecsobserver
extension/observer
extension/observer/k8sobserver
processor/groupbyattrsprocessor
processor/groupbytraceprocessor
processor/probabilisticsamplerprocessor
Expand Down
2 changes: 1 addition & 1 deletion cmd/configschema/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ require (
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect
github.com/aliyun/aliyun-log-go-sdk v0.1.54 // indirect
github.com/andybalholm/brotli v1.0.5 // indirect
github.com/antonmedv/expr v1.15.1 // indirect
github.com/antonmedv/expr v1.15.2 // indirect
github.com/apache/arrow/go/v12 v12.0.1 // indirect
github.com/apache/pulsar-client-go v0.8.1 // indirect
github.com/apache/pulsar-client-go/oauth2 v0.0.0-20220120090717-25e59572242e // indirect
Expand Down
4 changes: 2 additions & 2 deletions cmd/configschema/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cmd/otelcontribcol/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ require (
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect
github.com/aliyun/aliyun-log-go-sdk v0.1.54 // indirect
github.com/andybalholm/brotli v1.0.5 // indirect
github.com/antonmedv/expr v1.15.1 // indirect
github.com/antonmedv/expr v1.15.2 // indirect
github.com/apache/arrow/go/v12 v12.0.1 // indirect
github.com/apache/pulsar-client-go v0.8.1 // indirect
github.com/apache/pulsar-client-go/oauth2 v0.0.0-20220120090717-25e59572242e // indirect
Expand Down
4 changes: 2 additions & 2 deletions cmd/otelcontribcol/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cmd/oteltestbedcol/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ require (
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/alecthomas/participle/v2 v2.1.0 // indirect
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect
github.com/antonmedv/expr v1.15.1 // indirect
github.com/antonmedv/expr v1.15.2 // indirect
github.com/apache/thrift v0.19.0 // indirect
github.com/armon/go-metrics v0.4.1 // indirect
github.com/aws/aws-sdk-go v1.45.7 // indirect
Expand Down
4 changes: 2 additions & 2 deletions cmd/oteltestbedcol/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/demo/.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
OTELCOL_IMG=otel/opentelemetry-collector:0.67.0
OTELCOL_IMG=otel/opentelemetry-collector:0.85.0
OTELCOL_ARGS=
2 changes: 1 addition & 1 deletion examples/demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ This demo uses `docker-compose` and by default runs against the
to the `examples/demo` folder and run:

```shell
docker-compose up -d
docker compose up -d
```

The demo exposes the following backends:
Expand Down
6 changes: 3 additions & 3 deletions examples/demo/otel-collector-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ exporters:
endpoint: "http://zipkin-all-in-one:9411/api/v2/spans"
format: proto

jaeger:
endpoint: jaeger-all-in-one:14250
otlp:
endpoint: jaeger-all-in-one:4317
tls:
insecure: true

Expand All @@ -36,7 +36,7 @@ service:
traces:
receivers: [otlp]
processors: [batch]
exporters: [logging, zipkin, jaeger]
exporters: [logging, zipkin, otlp]
metrics:
receivers: [otlp]
processors: [batch]
Expand Down
2 changes: 1 addition & 1 deletion exporter/datadogexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ require (
github.com/DataDog/zstd v1.5.2 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/Showmax/go-fqdn v1.0.0 // indirect
github.com/antonmedv/expr v1.15.1 // indirect
github.com/antonmedv/expr v1.15.2 // indirect
github.com/armon/go-metrics v0.4.1 // indirect
github.com/benbjohnson/clock v1.3.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
Expand Down
4 changes: 2 additions & 2 deletions exporter/datadogexporter/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions extension/observer/k8sobserver/k8s_fixtures_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"k8s.io/apimachinery/pkg/types"
)

// NewPod is a helper function for creating Pods for testing.
func NewPod(name, host string) *v1.Pod {
// newPod is a helper function for creating Pods for testing.
func newPod(name, host string) *v1.Pod {
pod := &v1.Pod{
ObjectMeta: metav1.ObjectMeta{
Namespace: "default",
Expand Down Expand Up @@ -38,7 +38,7 @@ func NewPod(name, host string) *v1.Pod {
return pod
}

var pod1V1 = NewPod("pod1", "localhost")
var pod1V1 = newPod("pod1", "localhost")
var pod1V2 = func() *v1.Pod {
pod := pod1V1.DeepCopy()
pod.Labels["pod-version"] = "2"
Expand Down Expand Up @@ -85,7 +85,7 @@ var container2StatusRunning = v1.ContainerStatus{
}

var podWithNamedPorts = func() *v1.Pod {
pod := NewPod("pod-2", "localhost")
pod := newPod("pod-2", "localhost")
pod.Labels = map[string]string{
"env": "prod",
}
Expand All @@ -104,8 +104,8 @@ func pointerBool(val bool) *bool {
return &val
}

// NewNode is a helper function for creating Nodes for testing.
func NewNode(name, hostname string) *v1.Node {
// newNode is a helper function for creating Nodes for testing.
func newNode(name, hostname string) *v1.Node {
return &v1.Node{
ObjectMeta: metav1.ObjectMeta{
Namespace: "namespace",
Expand Down Expand Up @@ -147,7 +147,7 @@ func NewNode(name, hostname string) *v1.Node {
}
}

var node1V1 = NewNode("node1", "localhost")
var node1V1 = newNode("node1", "localhost")
var node1V2 = func() *v1.Node {
node := node1V1.DeepCopy()
node.Labels["node-version"] = "2"
Expand Down
2 changes: 1 addition & 1 deletion extension/observer/k8sobserver/node_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ func TestNodeObjectToK8sNodeEndpoint(t *testing.T) {
},
}

endpoint := convertNodeToEndpoint("namespace", NewNode("name", "hostname"))
endpoint := convertNodeToEndpoint("namespace", newNode("name", "hostname"))
require.Equal(t, expectedNode, endpoint)
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ require (
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect
github.com/aliyun/aliyun-log-go-sdk v0.1.54 // indirect
github.com/andybalholm/brotli v1.0.5 // indirect
github.com/antonmedv/expr v1.15.1 // indirect
github.com/antonmedv/expr v1.15.2 // indirect
github.com/apache/arrow/go/v12 v12.0.1 // indirect
github.com/apache/pulsar-client-go v0.8.1 // indirect
github.com/apache/pulsar-client-go/oauth2 v0.0.0-20220120090717-25e59572242e // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions internal/filter/filterottl/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ func dropFn[K any]() (ottl.ExprFunc[K], error) {
}

type hasAttributeOnDatapointArguments struct {
Key string `ottlarg:"0"`
ExpectedVal string `ottlarg:"1"`
Key string
ExpectedVal string
}

func newHasAttributeOnDatapointFactory() ottl.Factory[ottlmetric.TransformContext] {
Expand All @@ -95,7 +95,7 @@ func hasAttributeOnDatapoint(key string, expectedVal string) (ottl.ExprFunc[ottl
}

type hasAttributeKeyOnDatapointArguments struct {
Key string `ottlarg:"0"`
Key string
}

func newHasAttributeKeyOnDatapointFactory() ottl.Factory[ottlmetric.TransformContext] {
Expand Down
2 changes: 1 addition & 1 deletion internal/filter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter
go 1.20

require (
github.com/antonmedv/expr v1.15.1
github.com/antonmedv/expr v1.15.2
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.85.0
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.85.0
Expand Down
4 changes: 2 additions & 2 deletions internal/filter/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 1 addition & 9 deletions pkg/ottl/expression.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,15 +280,7 @@ func (g StandardFunctionGetter[K]) Get(args Arguments) (Expr[K], error) {
}
for i := 0; i < fArgsVal.NumField(); i++ {
field := argsVal.Field(i)
argIndex, err := getArgumentIndex(i, argsVal)
if err != nil {
return Expr[K]{}, err
}
fArgIndex, err := getArgumentIndex(argIndex, fArgsVal)
if err != nil {
return Expr[K]{}, err
}
fArgsVal.Field(fArgIndex).Set(field)
fArgsVal.Field(i).Set(field)
}
fn, err := g.fact.CreateFunction(g.fCtx, fArgs)
if err != nil {
Expand Down
Loading

0 comments on commit a88abc8

Please sign in to comment.