Skip to content
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

Fix filelog parser configuration in testbed senders #30018

Merged
merged 1 commit into from
Jan 10, 2024

Conversation

swiatekm
Copy link
Contributor

@swiatekm swiatekm commented Dec 17, 2023

Description:

Filelog senders in testbed have incorrect parsing configurations, leading to lots of parse errors:

2023-12-16T18:19:53.515+0100	error	helper/transformer.go:98	Failed to process entry	{"kind": "receiver", "name": "filelog", "data_type": "logs", "operator_id": "regex_parser", "operator_type": "regex_parser", "error": {"description": "time parser: log entry does not have the expected parse_from field", "suggestion": "ensure that all entries forwarded to this parser contain the parse_from field", "details": {"parse_from": "body.time"}}, "action": "send", "entry": {"observed_timestamp":"2023-12-16T18:19:53.515753831+01:00","timestamp":"0001-01-01T00:00:00Z","body":"2023-12-16 INFO3 Load Generator Counter #0 batch_index=batch_1 item_index=item_1 a=test b=5 c=3 d=true","attributes":{"log.file.name":"perf-logs.log2985945617","msg":"Load Generator Counter #0 batch_index=batch_1 item_index=item_1 a=test b=5 c=3 d=true","sev":"INFO3","time":"2023-12-16"},"severity":0,"scope_name":""}}

This change fixes the errors.

Note that there's going to be a change in benchmark results, as right now the error handling methods figure prominently in the benchmark. While it's not invalid to benchmark these, in general I think we'd prefer to check the happy path instead.

Testing:
Reran the testbed tests, saw no errors in agent logs.

@swiatekm
Copy link
Contributor Author

Should I add a changelog entry for this? Kind of a minor change, but maybe it'd be good to have one as reference for the different benchmark results?

Copy link
Contributor

github-actions bot commented Jan 1, 2024

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Jan 1, 2024
@fatsheep9146 fatsheep9146 added Skip Changelog PRs that do not require a CHANGELOG.md entry and removed Stale labels Jan 1, 2024
@@ -238,6 +241,7 @@ func NewKubernetesCRIContainerdWriter() *FileLogK8sWriter {
id: parser-containerd
regex: '^(?P<time>[^ ^Z]+Z) (?P<stream>stdout|stderr) (?P<logtag>[^ ]*) (?P<log>.*)$'
output: extract_metadata_from_filepath
parse_to: body
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I run the test locally and found kubernetes containers test case does not file error as you posts, only filelog and filelog checkpoints has parse errors, I think the change in stanza.go already fix these two.

So what is the change in k8s.go for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was fixed in #30301 so it's not necessary anymore. I've removed it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was fixed in #30301 so it's not necessary anymore. I've removed it.

Thanks!

@fatsheep9146
Copy link
Contributor

Here is the agent.log for kubernetes containers test

2024-01-10T13:57:49.833+0800	info	[email protected]/telemetry.go:86	Setting up own telemetry...
2024-01-10T13:57:49.833+0800	info	[email protected]/telemetry.go:159	Serving metrics	{"address": ":8888", "level": "Basic"}
2024-01-10T13:57:49.834+0800	info	[email protected]/service.go:151	Starting oteltestbedcol...	{"Version": "0.92.0-dev", "NumCPU": 10}
2024-01-10T13:57:49.834+0800	info	extensions/extensions.go:34	Starting extensions...
2024-01-10T13:57:49.834+0800	info	extensions/extensions.go:37	Extension is starting...	{"kind": "extension", "name": "pprof"}
2024-01-10T13:57:49.846+0800	info	[email protected]/pprofextension.go:60	Starting net/http/pprof server	{"kind": "extension", "name": "pprof", "config": {"TCPAddr":{"Endpoint":"localhost:1777","DialerConfig":{"Timeout":0}},"BlockProfileFraction":0,"MutexProfileFraction":0,"SaveToFile":"/Users/zhaoziqi/Documents/go/src/go.opentelemetry.io/opentelemetry-collector-contrib/testbed/tests/results/TestLog10kDPS/kubernetes_containers/cpu.prof"}}
2024-01-10T13:57:49.847+0800	info	extensions/extensions.go:52	Extension started.	{"kind": "extension", "name": "pprof"}
2024-01-10T13:57:49.848+0800	info	adapter/receiver.go:45	Starting stanza receiver	{"kind": "receiver", "name": "filelog", "data_type": "logs"}
2024-01-10T13:57:49.848+0800	info	[email protected]/service.go:177	Everything is ready. Begin running and processing data.
2024-01-10T13:57:50.049+0800	info	fileconsumer/file.go:268	Started watching file	{"kind": "receiver", "name": "filelog", "data_type": "logs", "component": "fileconsumer", "path": "/var/folders/68/j67hyhkd1vb_lb3l5kzv6ngw0000gp/T/namespace-3647492001_test-pod_000011112222333344445555666677778888/3138687811/644767115.log"}
2024-01-10T13:58:04.945+0800	info	[email protected]/collector.go:258	Received signal from OS	{"signal": "terminated"}
2024-01-10T13:58:04.945+0800	info	[email protected]/service.go:191	Starting shutdown...
2024-01-10T13:58:04.945+0800	info	adapter/receiver.go:140	Stopping stanza receiver	{"kind": "receiver", "name": "filelog", "data_type": "logs"}
2024-01-10T13:58:04.946+0800	info	extensions/extensions.go:59	Stopping extensions...
2024-01-10T13:58:05.061+0800	info	[email protected]/service.go:205	Shutdown complete.

@fatsheep9146 fatsheep9146 added the ready to merge Code review completed; ready to merge by maintainers label Jan 10, 2024
@bogdandrutu bogdandrutu merged commit d40f603 into open-telemetry:main Jan 10, 2024
90 checks passed
@github-actions github-actions bot added this to the next release milestone Jan 10, 2024
cparkins pushed a commit to AmadeusITGroup/opentelemetry-collector-contrib that referenced this pull request Jan 10, 2024
…0018)

**Description:**

Filelog senders in testbed have incorrect parsing configurations,
leading to lots of parse errors:

```
2023-12-16T18:19:53.515+0100	error	helper/transformer.go:98	Failed to process entry	{"kind": "receiver", "name": "filelog", "data_type": "logs", "operator_id": "regex_parser", "operator_type": "regex_parser", "error": {"description": "time parser: log entry does not have the expected parse_from field", "suggestion": "ensure that all entries forwarded to this parser contain the parse_from field", "details": {"parse_from": "body.time"}}, "action": "send", "entry": {"observed_timestamp":"2023-12-16T18:19:53.515753831+01:00","timestamp":"0001-01-01T00:00:00Z","body":"2023-12-16 INFO3 Load Generator Counter #0 batch_index=batch_1 item_index=item_1 a=test b=5 c=3 d=true","attributes":{"log.file.name":"perf-logs.log2985945617","msg":"Load Generator Counter #0 batch_index=batch_1 item_index=item_1 a=test b=5 c=3 d=true","sev":"INFO3","time":"2023-12-16"},"severity":0,"scope_name":""}}
```

This change fixes the errors.

Note that there's going to be a change in benchmark results, as right
now the error handling methods figure prominently in the benchmark.
While it's not invalid to benchmark these, in general I think we'd
prefer to check the happy path instead.

**Testing:**
Reran the testbed tests, saw no errors in agent logs.
@swiatekm swiatekm deleted the fix/testbed/log-parsers branch January 11, 2024 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Code review completed; ready to merge by maintainers Skip Changelog PRs that do not require a CHANGELOG.md entry testbed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants