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

[exporter] Remove jaeger dbmodel dependency #36972

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

zzzk1
Copy link

@zzzk1 zzzk1 commented Dec 27, 2024

Description

Copy the Jaeger plugin/storage/es/spanstore/dbmodel for logzioexporter, and remove the dependency. The dbmodel package in Jaeger will be internal from v1.65 (jaegertracing/jaeger#6428).

Link to tracking issue

Fixes #36970

Testing

Covered by existing

yurishkuro pushed a commit to jaegertracing/jaeger that referenced this pull request Dec 27, 2024
## Which problem is this PR solving?
- Resolves #6410
- Prerequisite:
open-telemetry/opentelemetry-collector-contrib#36972

## Description of the changes
- move plugin/storage/es/spanstore/dbmodel to
plugin/storage/es/spanstore/internal/dbmodel

## How was this change tested?
- 

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [ ] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `npm run lint` and `npm run test`

---------

Signed-off-by: zzzk1 <[email protected]>
Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

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

lgtm, but code owners need to sign off -- @yotamloe

}

// LogzioSpan is same as ESSpan with a few different json field names and an addition on type field.
type LogzioSpan struct {
Copy link
Member

Choose a reason for hiding this comment

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

none of the new structs should public

Copy link
Contributor

Choose a reason for hiding this comment

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

@zzzk1 I agree with @yurishkuro

Copy link
Contributor

@fatsheep9146 fatsheep9146 left a comment

Choose a reason for hiding this comment

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

Please add a changelog.

@zzzk1
Copy link
Author

zzzk1 commented Dec 29, 2024

@fatsheep9146 @yurishkuro @yotamloe Improved, please take a look 😊

}

// only for testing span is ES database representation of the domain span.
type span struct {
Copy link
Member

Choose a reason for hiding this comment

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

why is this type needed? why not use logziospan?

Copy link
Author

Choose a reason for hiding this comment

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

why is this type needed? why not use logziospan?

unit test fromDomain_test.go needs this struct to compare

Tag map[string]any `json:"JaegerTag,omitempty"`
Logs []spanLog `json:"logs"`
Process process `json:"process,omitempty"`
Type string `json:"type"`
}
Copy link
Member

Choose a reason for hiding this comment

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

still unnecessary changes to the type - why change the field order?

Copy link
Member

Choose a reason for hiding this comment

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

also, since you need to reference moved types like TraceID, Process, etc., you can define them in internal/dbmodel package, where they can remain public but not usable outside of this exporter, and the code referring to them will not need to change, just the import.

)

// Span is ES database representation of the domain span.
type Span struct {
Copy link
Author

Choose a reason for hiding this comment

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

@yurishkuro func TestFromDomainEmbedProcess(t *testing.T) needs this struct

Copy link
Member

Choose a reason for hiding this comment

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

why can't that test use logziospan?

@@ -7,7 +7,8 @@ import (
"encoding/json"
Copy link
Member

Choose a reason for hiding this comment

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

I would move this file to internal/dbmodel as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Eliminate logziospan dependency on the plugin/storage/es/spanstore/dbmodel
5 participants