Skip to content

Resolve dataset naming conflict#344

Merged
mtojek merged 2 commits intoelastic:masterfrom
mtojek:fix-prometheus-conflict
Apr 15, 2020
Merged

Resolve dataset naming conflict#344
mtojek merged 2 commits intoelastic:masterfrom
mtojek:fix-prometheus-conflict

Conversation

@mtojek
Copy link
Copy Markdown
Contributor

@mtojek mtojek commented Apr 14, 2020

This PR adjusts the dataset visiting code to resolve naming conflicts.

In case of a dataset conflict, same name, same type (logs, metrics), the latter dataset will replace existing one:
prometheus/collector will be replaced with x-pack/prometheus/collector.

Also, cleaned some old files.

Closes: #336

@mtojek mtojek requested a review from ruflin April 14, 2020 15:03
@mtojek mtojek self-assigned this Apr 14, 2020
pc.datasets = append(pc.datasets, dc)
} else {
dc.name = fmt.Sprintf("%s-%s", dc.name, dc.beatType)
pc.datasets[i] = dc
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It would be nice to log if we overwrite a dataset so at least looking at the log output we could tell how many are overwritten.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@mtojek mtojek merged commit f28fabe into elastic:master Apr 15, 2020
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.

prometheus/collector: conflicting name

2 participants