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

Refactor Elasticsearch Storage Configs #5480

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

Conversation

akagami-harsh
Copy link
Member

@akagami-harsh akagami-harsh commented May 23, 2024

Which problem is this PR solving?

Description of the changes

  • grouped related configs in elasticsearch into sub-types to make YAML configuration look more structured and readable

How was this change tested?

  • ci

Checklist

Signed-off-by: Harshvir Potpose <hpotpose62@gmail.com>
@akagami-harsh akagami-harsh requested a review from a team as a code owner May 23, 2024 11:38
akagami-harsh and others added 2 commits May 23, 2024 17:09
Signed-off-by: Harshvir Potpose <hpotpose62@gmail.com>
Copy link

codecov bot commented May 23, 2024

Codecov Report

Attention: Patch coverage is 94.96855% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 95.52%. Comparing base (901165c) to head (2f3d649).
Report is 6 commits behind head on main.

Files Patch % Lines
pkg/es/config/config.go 82.22% 5 Missing and 3 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5480   +/-   ##
=======================================
  Coverage   95.52%   95.52%           
=======================================
  Files         331      331           
  Lines       16155    16167   +12     
=======================================
+ Hits        15432    15444   +12     
  Misses        548      548           
  Partials      175      175           
Flag Coverage Δ
badger_v1 8.04% <0.00%> (-0.02%) ⬇️
badger_v2 1.93% <0.00%> (-0.01%) ⬇️
cassandra-3.x-v1 16.41% <0.00%> (-0.03%) ⬇️
cassandra-3.x-v2 1.85% <0.00%> (-0.01%) ⬇️
cassandra-4.x-v1 16.41% <0.00%> (-0.03%) ⬇️
cassandra-4.x-v2 1.85% <0.00%> (-0.01%) ⬇️
elasticsearch-7.x 1.77% <0.00%> (-0.01%) ⬇️
elasticsearch-8.x 1.76% <0.00%> (-0.01%) ⬇️
grpc_v1 9.51% <0.00%> (-0.02%) ⬇️
grpc_v2 7.57% <0.00%> (-0.02%) ⬇️
kafka 9.77% <0.00%> (-0.02%) ⬇️
opensearch-1.x 1.77% <0.00%> (+<0.01%) ⬆️
opensearch-2.x 1.76% <0.00%> (-0.02%) ⬇️
unittests 93.92% <94.96%> (+<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.

Comment on lines +23 to +24
enabled: false
create_mappings: true
Copy link
Member

Choose a reason for hiding this comment

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

this looks confusing to me - when something is enabled: false I don't expect any other properties to make sense. Is create_mappings even related to aliases?

@@ -46,46 +46,70 @@ import (

// Configuration describes the configuration properties needed to connect to an ElasticSearch cluster
type Configuration struct {
Copy link
Member

Choose a reason for hiding this comment

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

Similar to Badger, let's not change the v1 config but create a v2 config. For example, I don' think we need to support everything that v1 supported, specifically I think we should only support ILM and Data Streams.

Comment on lines +74 to +77
DateLayoutSpans string `mapstructure:"-"`
DateLayoutServices string `mapstructure:"-"`
DateLayoutSampling string `mapstructure:"-"`
DateLayoutDependencies string `mapstructure:"-"`
Copy link
Member

Choose a reason for hiding this comment

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

this naming duplication suggests to me that we have some groups of settings that individually apply to different indices (spans, services, sampling, deps). Maybe this top level entities should be the main keys in the config, and internally they can share the same attributes, e.g.

spans:
  date_layout:
  rollover_frequency:
services:
  date_layout:
  rollover_frequency:

We could reuse the same struct then for each of the entities.

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.

None yet

2 participants