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

example: add kubernetes logs example #2606

Merged

Conversation

sumo-drosiek
Copy link
Member

Description:
This PR adds example configuration to handle kubernetes container logs using filelog receiver
This depends on the #2564

Link to tracking Issue:
#2266

Testing:
N/A
tests which were performed to get results are going to be issued in another PR

Documentation:
README.md

@sumo-drosiek sumo-drosiek requested a review from a team March 8, 2021 13:34
@codecov
Copy link

codecov bot commented Mar 8, 2021

Codecov Report

Merging #2606 (b85326c) into main (6566113) will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2606      +/-   ##
==========================================
- Coverage   91.37%   91.35%   -0.02%     
==========================================
  Files         431      431              
  Lines       21461    21461              
==========================================
- Hits        19609    19605       -4     
- Misses       1387     1390       +3     
- Partials      465      466       +1     
Flag Coverage Δ
integration 69.18% <ø> (-0.07%) ⬇️
unit 90.25% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...rometheusexecreceiver/subprocessmanager/manager.go 70.00% <0.00%> (-6.00%) ⬇️
processor/groupbytraceprocessor/event.go 95.96% <0.00%> (-0.81%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6566113...b85326c. Read the comment docs.

@sumo-drosiek
Copy link
Member Author

I messed up sth with rebasing

@sumo-drosiek sumo-drosiek reopened this Mar 8, 2021
@sumo-drosiek sumo-drosiek force-pushed the drosiek-kubernetes-example branch from 8e09454 to c2c6989 Compare March 8, 2021 20:49
examples/kubernetes/README.md Show resolved Hide resolved
examples/kubernetes/otel-collector-config.yml Outdated Show resolved Hide resolved
examples/kubernetes/otel-collector-config.yml Show resolved Hide resolved
k8s.container.name: 'EXPR($.container_name)'
k8s.namespace.name: 'EXPR($.namespace)'
k8s.pod.name: 'EXPR($.pod_name)'
run_id: 'EXPR($.run_id)'
Copy link
Member

Choose a reason for hiding this comment

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

What is run_id? Is it something that requires a semantic convention in Otel spec?

Copy link
Member Author

@sumo-drosiek sumo-drosiek Mar 9, 2021

Choose a reason for hiding this comment

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

I'm not sure if its really needed. It defines from which run of a pod logs are coming. In case pod is restarted the run_id is incremented. It could be sth like k8s.container.run_number, k8s.container.run_id

Even more like container.* as specified in semantic conventions

Copy link
Member

Choose a reason for hiding this comment

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

Can you please create an issue for this and for stream and add to Basic Logs milestone in this repo so that we can decide what to do about it.

# Move out attributes to Attributes
- type: metadata
attributes:
stream: 'EXPR($.stream)'
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to keep stream as an attribute? It seems like is it only marginally useful. If we want to have it we need to come up with some idea for a semantic convention. Otel spec spec does not encourage attribute names like that: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/attribute-and-label-naming.md#recommendations-for-opentelemetry-authors

Copy link
Member Author

Choose a reason for hiding this comment

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

Is there any semantic convention for file_path, file_name and so on? I think stream should be added there. I consider it rather important. As end user I would like to be able to manage logs differently depending on a stream type

Copy link
Member

Choose a reason for hiding this comment

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

No, I don't think we have semantic conventions like that. Can you please open an issue here in this repo to decide what we want to do with this attribute and we can address it in a future PR.

@tigrannajaryan
Copy link
Member

@sumo-drosiek we can merge this example as is and work on improvements later. If you prefer this approach please create new issues for each unresolved comment and I will merge the PR.

Dominik Rosiek and others added 2 commits March 10, 2021 08:59
Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>
Co-authored-by: Patryk Małek <69143962+pmalek-sumo@users.noreply.github.com>
Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>
@sumo-drosiek sumo-drosiek force-pushed the drosiek-kubernetes-example branch from c2c6989 to 4f577dc Compare March 10, 2021 07:59
Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>
@sumo-drosiek
Copy link
Member Author

sumo-drosiek commented Mar 10, 2021

I added daemonest configuration in another commit, and created PR issue for attribute names

examples/kubernetes/otel-collector-config.yml Outdated Show resolved Hide resolved
examples/kubernetes/otel-collector-config.yml Outdated Show resolved Hide resolved
k8s.container.name: 'EXPR($.container_name)'
k8s.namespace.name: 'EXPR($.namespace)'
k8s.pod.name: 'EXPR($.pod_name)'
run_id: 'EXPR($.run_id)'
Copy link
Member

Choose a reason for hiding this comment

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

Can you please create an issue for this and for stream and add to Basic Logs milestone in this repo so that we can decide what to do about it.

examples/kubernetes/otel-collector.yaml Show resolved Hide resolved
examples/kubernetes/otel-collector.yaml Outdated Show resolved Hide resolved
examples/kubernetes/otel-collector.yaml Show resolved Hide resolved
@tigrannajaryan
Copy link
Member

@sumo-drosiek I left a couple more comments to do some final touches and we can merge it. This is great.

…logs

Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>
@sumo-drosiek sumo-drosiek force-pushed the drosiek-kubernetes-example branch from 481d59a to b85326c Compare March 15, 2021 09:25
@tigrannajaryan
Copy link
Member

@sumo-drosiek please create issues to decide what we do with stream and run_id fields (whether we want to have Otel semantic conventions) and add the issues to Basic Log Collection milestone.

This PR looks good, I will merge it now. Thanks.

@tigrannajaryan tigrannajaryan merged commit 3cf9d87 into open-telemetry:main Mar 16, 2021
@sumo-drosiek
Copy link
Member Author

@tigrannajaryan I already created issue: #2628

@sumo-drosiek sumo-drosiek deleted the drosiek-kubernetes-example branch March 16, 2021 15:31
pmatyjasek-sumo referenced this pull request in pmatyjasek-sumo/opentelemetry-collector-contrib Apr 28, 2021
**Description:** 
This PR adds example configuration to handle kubernetes container logs using filelog receiver
This depends on the #2564

**Link to tracking Issue:**
#2266 

**Testing:**
N/A
tests which were performed to get results are going to be issued in another PR

**Documentation:**
README.md
ljmsc referenced this pull request in ljmsc/opentelemetry-collector-contrib Feb 21, 2022
* add env support for otel_span configuration

Signed-off-by: Cuichen Li <cuichli@cisco.com>

* update changelog

* update changelog and some logic based on comment

* Update CHANGELOG.md

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* add document about retrieve value from environment variable

Signed-off-by: Cuichen Li <cuichli@cisco.com>

* remove trailing whitespace

Signed-off-by: Cuichen Li <cuichli@cisco.com>

* parse environment variable before apply the options

* Update CHANGELOG.md

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Update sdk/trace/provider_test.go

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Update CHANGELOG.md

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants