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

[jaeger-v2] Refactor ElasticSearch/OpenSearch configurations to have more logical groupings #6090

Merged
merged 13 commits into from
Oct 18, 2024

Conversation

mahadzaryab1
Copy link
Collaborator

@mahadzaryab1 mahadzaryab1 commented Oct 15, 2024

Which problem is this PR solving?

Description of the changes

  • Added more groupings for the following sub-configurations in the ElasticSearch/OpenSearch configurations
    • Sniffing
    • Authentication
    • Bulk Processing
  • The migration guide from v1 to v2 can be viewed here.

How was this change tested?

  • CI

Checklist

Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Copy link

codecov bot commented Oct 15, 2024

Codecov Report

Attention: Patch coverage is 98.78049% with 1 line in your changes missing coverage. Please review.

Project coverage is 96.46%. Comparing base (32112eb) to head (dc17b76).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
pkg/es/config/config.go 97.05% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6090   +/-   ##
=======================================
  Coverage   96.46%   96.46%           
=======================================
  Files         352      352           
  Lines       19953    19961    +8     
=======================================
+ Hits        19247    19255    +8     
  Misses        522      522           
  Partials      184      184           
Flag Coverage Δ
badger_v1 8.44% <0.00%> (-0.01%) ⬇️
badger_v2 1.71% <0.00%> (-0.01%) ⬇️
cassandra-4.x-v1 14.59% <0.00%> (-0.02%) ⬇️
cassandra-4.x-v2 1.65% <0.00%> (-0.01%) ⬇️
cassandra-5.x-v1 14.59% <0.00%> (-0.02%) ⬇️
cassandra-5.x-v2 1.65% <0.00%> (-0.01%) ⬇️
elasticsearch-6.x-v1 18.68% <65.85%> (+0.05%) ⬆️
elasticsearch-7.x-v1 18.77% <65.85%> (+0.05%) ⬆️
elasticsearch-8.x-v1 18.94% <69.51%> (+0.05%) ⬆️
elasticsearch-8.x-v2 1.70% <0.00%> (-0.01%) ⬇️
grpc_v1 8.80% <0.00%> (-0.01%) ⬇️
grpc_v2 6.73% <0.00%> (+<0.01%) ⬆️
kafka-v1 9.01% <0.00%> (-0.01%) ⬇️
kafka-v2 1.71% <0.00%> (-0.01%) ⬇️
memory_v2 1.71% <0.00%> (-0.01%) ⬇️
opensearch-1.x-v1 18.82% <65.85%> (+0.06%) ⬆️
opensearch-2.x-v1 18.82% <65.85%> (+0.06%) ⬆️
opensearch-2.x-v2 1.71% <0.00%> (-0.01%) ⬇️
tailsampling-processor 0.48% <0.00%> (-0.01%) ⬇️
unittests 95.38% <98.78%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
@mahadzaryab1 mahadzaryab1 changed the title [WIP][jaeger-v2] Refactor ElasticSearch/OpenSearch configurations to have more logical groupings [jaeger-v2] Refactor ElasticSearch/OpenSearch configurations to have more logical groupings Oct 16, 2024
@mahadzaryab1 mahadzaryab1 marked this pull request as ready for review October 16, 2024 00:17
@mahadzaryab1 mahadzaryab1 requested a review from a team as a code owner October 16, 2024 00:17
pkg/es/config/config.go Outdated Show resolved Hide resolved
pkg/es/config/config.go Outdated Show resolved Hide resolved
Shards int64 `mapstructure:"shards"`
// Replicas is the number of replicas per index in Elasticsearch.
Replicas int64 `mapstructure:"replicas"`
// RolloverFrequency rotates indices over the given period. For example, "day" creates
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for adding docs. Is this behavior unconditional or only in some cases, like when useILM is false?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

no, it's not unconditional. See reader.go:151 - this param is not used when archive || useReadWriteAliases. Also, the doc string is not even talking about using the param at read time, it says "rotates" - and I think that's definitely not unconditional.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@yurishkuro Is this rotation handled by ILM and this field here is just used for reading? https://github.com/jaegertracing/jaeger/blob/main/plugin/storage/es/factory.go#L273-L282. I don't see this field being used for any writing.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I think you were right. The index rotation is always external to Jaeger, either via a rollover script or via ILM. And the reader only needs this setting to know how to translate a [from, to] interval into distinct index names (by doing t=t.Add(interval))

Copy link
Member

Choose a reason for hiding this comment

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

But given that, the doc string is wrong as it talks about creating rollover indices.

pkg/es/config/config.go Outdated Show resolved Hide resolved
pkg/es/config/config.go Outdated Show resolved Hide resolved
pkg/es/config/config.go Outdated Show resolved Hide resolved
pkg/es/config/config.go Outdated Show resolved Hide resolved
pkg/es/config/config.go Show resolved Hide resolved
pkg/es/config/config.go Outdated Show resolved Hide resolved
@yurishkuro yurishkuro added the changelog:exprimental Change to an experimental part of the code label Oct 16, 2024
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
pkg/es/config/config.go Outdated Show resolved Hide resolved
pkg/es/config/config.go Outdated Show resolved Hide resolved
mahadzaryab1 and others added 3 commits October 17, 2024 21:12
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
pkg/es/config/config.go Outdated Show resolved Hide resolved
pkg/es/config/config.go Outdated Show resolved Hide resolved
pkg/es/config/config.go Show resolved Hide resolved
pkg/es/config/config.go Outdated Show resolved Hide resolved
pkg/es/config/config.go Outdated Show resolved Hide resolved
pkg/es/config/config.go Outdated Show resolved Hide resolved
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
options.DiscoverNodesOnStart = c.Sniffer
options.Username = c.Authentication.BasicAuthentication.Username
options.Password = c.Authentication.BasicAuthentication.Password
options.DiscoverNodesOnStart = c.Sniffing.Enabled
Copy link
Member

Choose a reason for hiding this comment

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

so for v8 only the enabled is used, not the UseHTTPS? Is it because v8 client always uses https?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@yurishkuro yeah, that seems to be the case. The following is used when constructing the client.

// addrFromCloudID extracts the Elasticsearch URL from CloudID.
// See: https://www.elastic.co/guide/en/cloud/current/ec-cloud-id.html
func addrFromCloudID(input string) (string, error) {
	var scheme = "https://"
...
}

Copy link
Member

Choose a reason for hiding this comment

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

It would be good to have a comment on the field mentioning that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

logger.Warn("Token file and token propagation are both enabled, token from file won't be used")
}
tokenFromFile, err := loadTokenFromFile(c.TokenFilePath)
tokenFromFile, err := loadTokenFromFile(c.Authentication.BearerTokenAuthentication.FilePath)
Copy link
Member

Choose a reason for hiding this comment

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

weird that despite the PR title #4342 there is no "reloading" of the file, only at init time (whereas password does get reloaded). But since nobody complained ...

I don't see much documentation on the website about how this token is supposed to work, specifically any pointers to the documentation for the actual storage (e.g. ES or hosted ES). Might have been some references in the original issues but hard to find them.

Copy link
Member

Choose a reason for hiding this comment

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

@yurishkuro yurishkuro merged commit fe700fe into jaegertracing:main Oct 18, 2024
49 checks passed
yurishkuro pushed a commit that referenced this pull request Oct 19, 2024
## Which problem is this PR solving?
- Part of #6059

## Description of the changes
- Added some remaining documentation to the ElasticSearch configuration
that was left over from #6090

## How was this change tested?
- CI

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] 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`: `yarn lint` and `yarn test`

Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
mahadzaryab1 added a commit to mahadzaryab1/jaeger that referenced this pull request Oct 23, 2024
…rtracing#6103)

## Which problem is this PR solving?
- Part of jaegertracing#6059

## Description of the changes
- Added some remaining documentation to the ElasticSearch configuration
that was left over from jaegertracing#6090

## How was this change tested?
- CI

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] 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`: `yarn lint` and `yarn test`

Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
chahatsagarmain pushed a commit to chahatsagarmain/jaeger that referenced this pull request Oct 23, 2024
…more logical groupings (jaegertracing#6090)

## Which problem is this PR solving?
- Resolves jaegertracing#6059

## Description of the changes
- Added more groupings for the following sub-configurations in the
ElasticSearch/OpenSearch configurations
  - Sniffing 
  - Authentication
  - Bulk Processing
- The migration guide from v1 to v2 can be viewed
[here](https://docs.google.com/document/d/1rabu8zvjoZeHx-HNqvK5kjsujMEBC7DkR2MYeOvB6HI/edit?tab=t.0#heading=h.abjgb642qlsg).

## How was this change tested?
- CI

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] 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`: `yarn lint` and `yarn test`

---------

Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
chahatsagarmain pushed a commit to chahatsagarmain/jaeger that referenced this pull request Oct 23, 2024
…rtracing#6103)

## Which problem is this PR solving?
- Part of jaegertracing#6059

## Description of the changes
- Added some remaining documentation to the ElasticSearch configuration
that was left over from jaegertracing#6090

## How was this change tested?
- CI

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] 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`: `yarn lint` and `yarn test`

Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:exprimental Change to an experimental part of the code storage/elasticsearch v2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[jaeger-v2] Refactor ElasticSearch/OpenSearch Storage Configurations To Align With OTEL
2 participants