Skip to content

Commit

Permalink
Merge branch 'open-telemetry:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
narcis96 authored Nov 6, 2024
2 parents c28c8a0 + 8daf962 commit c8e644f
Show file tree
Hide file tree
Showing 39 changed files with 1,734 additions and 628 deletions.
27 changes: 27 additions & 0 deletions .chloggen/fix-panic-wel.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: bug_fix

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

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Fix panic when rendering long event messages.

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

# (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: []
2 changes: 1 addition & 1 deletion .chloggen/routing-connector-by-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ change_type: enhancement
component: routingconnector

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Add ability to route logs by request metadata.
note: Add ability to route by request metadata.

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [19738]
Expand Down
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ extension/httpforwarderextension/ @open-teleme
extension/jaegerremotesampling/ @open-telemetry/collector-contrib-approvers @yurishkuro @frzifus
extension/oauth2clientauthextension/ @open-telemetry/collector-contrib-approvers @pavankrish123 @jpkrohling
extension/observer/ @open-telemetry/collector-contrib-approvers @dmitryax
extension/observer/cfgardenobserver/ @open-telemetry/collector-contrib-approvers @crobert-1 @cemdk @tomasmota @m1rp @jriguera
extension/observer/cfgardenobserver/ @open-telemetry/collector-contrib-approvers @crobert-1 @cemdk @m1rp @jriguera
extension/observer/dockerobserver/ @open-telemetry/collector-contrib-approvers @MovieStoreGuy
extension/observer/ecsobserver/ @open-telemetry/collector-contrib-approvers @dmitryax
extension/observer/hostobserver/ @open-telemetry/collector-contrib-approvers @MovieStoreGuy
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
run: make chlog-preview > changelog_preview.md
- name: Install markdown-link-check
if: ${{ !contains(github.event.pull_request.labels.*.name, 'dependencies') && !contains(github.event.pull_request.labels.*.name, 'Skip Changelog') && !contains(github.event.pull_request.title, '[chore]')}}
run: npm install -g markdown-link-check
run: npm install -g markdown-link-check@3.12.2
- name: Run markdown-link-check
if: ${{ !contains(github.event.pull_request.labels.*.name, 'dependencies') && !contains(github.event.pull_request.labels.*.name, 'Skip Changelog') && !contains(github.event.pull_request.title, '[chore]')}}
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-links.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
fetch-depth: 0

- name: Install markdown-link-check
run: npm install -g markdown-link-check
run: npm install -g markdown-link-check@3.12.2

- name: Run markdown-link-check
run: |
Expand Down
1 change: 0 additions & 1 deletion cmd/githubgen/allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ zpzhuSplunk
thmshmm
galrose
cemdk
tomasmota
m1rp
jriguera
abhishek-at-cloudwerx
Expand Down
1 change: 0 additions & 1 deletion connector/routingconnector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ The following settings are available:
### Limitations

- The `match_once` setting is only supported when using the `resource` context. If any routes use `log` or `request` context, `match_once` must be set to `true`.
- The `request` context is only supported for logs at this time.
- The `request` context requires use of the `condition` setting, and relies on a very limited grammar. Conditions must be in the form of `request["key"] == "value"` or `request["key"] != "value"`. (In the future, this grammar may be expanded to support more complex conditions.)

### Supported [OTTL] functions
Expand Down
12 changes: 6 additions & 6 deletions connector/routingconnector/logs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ func TestLogsConnectorDetailed(t *testing.T) {
),
},
{
name: "match_resource_then_logs",
name: "mixed/match_resource_then_logs",
cfg: testConfig(
withRoute("resource", isResourceA, idSink0),
withRoute("log", isLogE, idSink1),
Expand All @@ -831,7 +831,7 @@ func TestLogsConnectorDetailed(t *testing.T) {
expectSinkD: plogutiltest.NewLogs("B", "CD", "F"),
},
{
name: "match_logs_then_resource",
name: "mixed/match_logs_then_resource",
cfg: testConfig(
withRoute("log", isLogE, idSink0),
withRoute("resource", isResourceB, idSink1),
Expand All @@ -843,7 +843,7 @@ func TestLogsConnectorDetailed(t *testing.T) {
expectSinkD: plogutiltest.NewLogs("A", "CD", "F"),
},
{
name: "match_resource_then_grpc_request",
name: "mixed/match_resource_then_grpc_request",
cfg: testConfig(
withRoute("resource", isResourceA, idSink0),
withRoute("request", isAcme, idSink1),
Expand All @@ -856,7 +856,7 @@ func TestLogsConnectorDetailed(t *testing.T) {
expectSinkD: plog.Logs{},
},
{
name: "match_logs_then_grpc_request",
name: "mixed/match_logs_then_grpc_request",
cfg: testConfig(
withRoute("log", isLogF, idSink0),
withRoute("request", isAcme, idSink1),
Expand All @@ -869,7 +869,7 @@ func TestLogsConnectorDetailed(t *testing.T) {
expectSinkD: plog.Logs{},
},
{
name: "match_resource_then_http_request",
name: "mixed/match_resource_then_http_request",
cfg: testConfig(
withRoute("resource", isResourceA, idSink0),
withRoute("request", isAcme, idSink1),
Expand All @@ -882,7 +882,7 @@ func TestLogsConnectorDetailed(t *testing.T) {
expectSinkD: plog.Logs{},
},
{
name: "match_logs_then_http_request",
name: "mixed/match_logs_then_http_request",
cfg: testConfig(
withRoute("log", isLogF, idSink0),
withRoute("request", isAcme, idSink1),
Expand Down
5 changes: 5 additions & 0 deletions connector/routingconnector/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ func (c *metricsConnector) switchMetrics(ctx context.Context, md pmetric.Metrics
route := c.router.routeSlice[i]
matchedMetrics := pmetric.NewMetrics()
switch route.statementContext {
case "request":
if route.requestCondition.matchRequest(ctx) {
groupAllMetrics(groups, route.consumer, md)
md = pmetric.NewMetrics() // all metrics have been routed
}
case "", "resource":
pmetricutil.MoveResourcesIf(md, matchedMetrics,
func(rs pmetric.ResourceMetrics) bool {
Expand Down
Loading

0 comments on commit c8e644f

Please sign in to comment.