-
Notifications
You must be signed in to change notification settings - Fork 0
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
Handle sumo headers #6
Conversation
af256b0
to
69da48f
Compare
template string | ||
} | ||
|
||
func newSourceFormat(r *regexp.Regexp, text string) sourceFormat { |
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.
Add comment what arguments does this func
expect, i.e. what regex and what string and what are they used for.
7dff1de
to
d915b86
Compare
8f31410
to
941b403
Compare
d915b86
to
d5369d8
Compare
d5369d8
to
2e3f50f
Compare
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.
Ok, other than those small suggestions I think this is quite good.
I still haven't figured out a way to change functions' signatures so that we don't have to pass fields{}
whenever we want to send stuff without logs :(
config *Config | ||
client *http.Client | ||
filter filter | ||
ctx context.Context |
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.
One thing for sure: context.Context
is not meant to be stored and reused.
Change send
's signature (I'm OK with doing this in a separate PR) to accept ctx
as first parameter and for starters you can pass there context.Background()
or more explicitly context.TODO()
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.
This is intended to not pass context through 5 functions, Sender works totally synchronized so context will be used same way as passing it by function signature
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.
Will address it in another PR, probably with enabling logs
) | ||
|
||
func getTestSourceFormat(t *testing.T, template string) sourceFormat { | ||
r, err := regexp.Compile(`\%\{(\w+)\}`) |
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.
r, err := regexp.Compile(`\%\{(\w+)\}`) | |
r, err := regexp.Compile(sourceRegex) |
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.
It won't catch accidental change of the const
template: "%s/test", | ||
} | ||
|
||
r, err := regexp.Compile(`\%\{(\w+)\}`) |
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.
r, err := regexp.Compile(`\%\{(\w+)\}`) | |
r, err := regexp.Compile(sourceRegex) |
) * Create MetricDeclaration struct * Implement dimension dedup logic when adding rolledup dimensions (#6) * Implement dimension dedup logic when adding rolledup dimensions * Remove duplicated dimensions in metric declaration * Create benchmark for filtering with metric declarations and use assertCwMeasurementEqual for tests * Move helper test code to the top of file * Update dimRollup test * Aggregate dimensions and perform dedup * Minor code change * Fix test failure from merging new changes
**Description:** Fixes open-telemetry#2799 **Testing:** ``` ResourceLog #6 Resource labels: -> k8s.container.name: STRING(loggen) -> k8s.pod.uid: STRING(f7880852-38f9-4158-b37a-41b3436a3b95) -> k8s.namespace.name: STRING(default) -> k8s.pod.startTime: STRING(2021-03-24 23:18:27 +0000 UTC) -> k8s.node.name: STRING(ip-192-168-68-130.us-west-1.compute.internal) -> k8s.pod.labels.hello: STRING(world) -> k8s.pod.labels.app: STRING(appName) -> k8s.pod.annotations.splunk.com/index: STRING(main) -> host.name: STRING(ip-192-168-68-130.us-west-1.compute.internal) -> com.splunk.sourcetype: STRING(loggen) -> com.splunk.index: STRING(main) InstrumentationLibraryLogs #0 InstrumentationLibrary LogRecord #0 Timestamp: 1616627909498109658 Severity: Undefined ShortName: Body: { -> log: STRING(EPS: 99 ) } Attributes: -> k8s.namespace.name: STRING(default) -> k8s.pod.name: STRING(loggen-65dvk) -> run_id: STRING(0) -> k8s.container.name: STRING(loggen) ``` ![image](https://user-images.githubusercontent.com/12387289/112396117-d7f79780-8cbc-11eb-879f-07bb1eb4413a.png)
Handle sumo headers