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

Enable groupbyatttrs processor - take two #2635

Merged

Conversation

pmm-sumo
Copy link
Contributor

The previous PR unfortunately got in between switch master -> main and got merged into master (it seems it's the only one affected). Since it got accepted, can we re-merge it?

Description:

Introduces processor for grouping the trace or log records by specified key values, and then extracting the attributes from the record to resource level.

This initiative is broken down into 3 separate PRs:

  1. Config (already merged)

  2. The processor logic (already merged)

👉 3. Enabling the component (this PR)

Example: consider having such input:

InstrumentationLibraryLogs #0
LogRecord #0
Timestamp: 1606158664897894000
Severity:
ShortName:
Body: STRING("foo")
Attributes:
     -> action: STRING(login)
     -> namespace_name: STRING(kube-apiserver-docker-desktop)
     -> pod_name: STRING(kube-system)

With following config:

groupbyattrs:
  group_by_keys:
    - pod_name
    - namespace_name

The output is going to be:

Resource labels:
     -> namespace_name: STRING(kube-apiserver-docker-desktop)
     -> pod_name: STRING(kube-system)
InstrumentationLibraryLogs #0
LogRecord #0
Timestamp: 1606158617133076000
Severity:
ShortName:
Body: STRING("foo")
Attributes:
     -> action: STRING(login)

Link to tracking Issue: #1884

Testing: Unit tests added, manual tests performed on logs and traces

Documentation: Processor README.md included

Also enables actually recording processor metrics and clarifies naming
@codecov
Copy link

codecov bot commented Mar 11, 2021

Codecov Report

Merging #2635 (8ba128b) into main (5efd35d) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2635   +/-   ##
=======================================
  Coverage   91.37%   91.37%           
=======================================
  Files         433      433           
  Lines       21530    21531    +1     
=======================================
+ Hits        19674    19675    +1     
  Misses       1390     1390           
  Partials      466      466           
Flag Coverage Δ
integration 69.13% <0.00%> (+0.20%) ⬆️
unit 90.28% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
cmd/otelcontribcol/components.go 87.50% <100.00%> (+0.15%) ⬆️

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 5efd35d...8ba128b. Read the comment docs.

@tigrannajaryan
Copy link
Member

Copy of #2263 so already reviewed. Merging.

@tigrannajaryan tigrannajaryan merged commit d37eb9f into open-telemetry:main Mar 11, 2021
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.

4 participants