-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[processor/transform] Add ContextStatements config #15382
Merged
bogdandrutu
merged 29 commits into
open-telemetry:main
from
TylerHelmuth:tp-enhanced-contexts-2
Nov 8, 2022
Merged
Changes from 7 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
07457a8
Add ContextStatements config
TylerHelmuth 5f8471c
Add high-level context
TylerHelmuth 2da5d8a
Merge branch 'open-telemetry:main' into tp-enhanced-contexts-2
TylerHelmuth ffc1fee
respond to feedback
TylerHelmuth 38b7d9c
Fix merge
TylerHelmuth 9133edf
Merge branch 'open-telemetry:main' into tp-enhanced-contexts-2
TylerHelmuth cab0096
Merge branch 'open-telemetry:main' into tp-enhanced-contexts-2
TylerHelmuth edfe1a4
Adjust ParserCollection
TylerHelmuth cdf7c7e
Add example usage temporarily
TylerHelmuth a19bd17
apply feedback
TylerHelmuth 14d60b1
Split into individual files
TylerHelmuth 7e044a4
merge in upstream/main
TylerHelmuth 8950da0
Add spanevent and metric contexts
TylerHelmuth 438ce15
revert logs processor example
TylerHelmuth 34ff332
Fix NewParserCollection
TylerHelmuth 83acb90
Fix lint
TylerHelmuth 2b0db77
Fix checks
TylerHelmuth 0db5378
Refactor ParserCollection to have a base
TylerHelmuth 1bb36bc
Merge remote-tracking branch 'upstream/main' into tp-enhanced-contexts-2
TylerHelmuth ca2b55d
Update interface to handle context.Context
TylerHelmuth fecfb09
cleanup var names
TylerHelmuth fd20cfb
Fix case statement
TylerHelmuth 9c5d53e
Implement UnmarshalText for ContextID
TylerHelmuth bf06646
Switch to consumer.Signal
TylerHelmuth 3291593
Fix lint
TylerHelmuth f95c418
Update processor/transformprocessor/internal/common/logs.go
TylerHelmuth 7964803
Update processor/transformprocessor/internal/common/metrics.go
TylerHelmuth 98feb98
apply feedback
TylerHelmuth 8bb990d
Add back Options for each parser
TylerHelmuth File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright The OpenTelemetry Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package common // import "github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor/internal/common" | ||
|
||
const ( | ||
Resource string = "resource" | ||
Scope string = "scope" | ||
Trace string = "trace" | ||
DataPoint string = "datapoint" | ||
Log string = "log" | ||
) | ||
|
||
type ContextStatements struct { | ||
Context string `mapstructure:"context"` | ||
Statements []string `mapstructure:"statements"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why do you need these specialized calls?
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.
@bogdandrutu I made specialized calls to represent the possibility of Resource-only functions or Scope-only functions.
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.
Not sure we need a public API for that, just add a comment to the "Functions" that can be initialized with multiple contexts.
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.
@bogdandrutu This isn't a public API, it would never be moved to the OTTL. This is a way for the transform processor to enforce its definition of what functions are allowed to be used for Scope and Resource. Similar to how each signal in the transform processor has their own
functions.go
.