Skip to content

Conversation

@Francois-du-Plessis
Copy link
Contributor

@Francois-du-Plessis Francois-du-Plessis commented Jun 15, 2021

Calling ToInfluxDb multiple times with different filters does not work

Details on the issue fix or feature implementation

  • Removed single reporter per reporter type restriction
  • Updated DefaultReportMetricsRunner to run multiple reporters for a given reporter type

Confirm the following

  • I have ensured that I have merged the latest changes from the dev branch
  • I have successfully run a local build
  • I have included unit tests for the issue/feature
  • I have included the github issue number in my commits

Francois du Plessis added 2 commits June 15, 2021 17:30
…rs does not work

Altered MetricsReporterCollection to return a Enumaration of reporters of a specific type
Altered MetricsReporterColletion to NOT remove a reporter on addition if the reporter already exists in the collection
Updated tests.
Added tests checking multiple reporters.
@alhardy
Copy link
Collaborator

alhardy commented Jun 16, 2021

Could you create the PR on branch features/4.3.0 please. Sorry should make clearer in the readme

@Francois-du-Plessis Francois-du-Plessis changed the base branch from dev to features/4.3.0 June 16, 2021 08:28
@Havret
Copy link

Havret commented Jun 24, 2022

@Francois-du-Plessis, @alhardy Any update on this? It's over a year.

@Francois-du-Plessis
Copy link
Contributor Author

Francois-du-Plessis commented Jun 29, 2022

Hey @Havret, the maintainer is a bit busy with life at the moment. Workaround we are currently using is to wrap the reporter type into a unique type:

/// <summary>
/// Empty wrappper class of InfluxDbMetricsReporter to create a uniquely typed reporter.
/// </summary>
internal class UniqueReporter1InfluxDbReporter : InfluxDbMetricsReporter
{
    internal UniqueReporter1InfluxDbReporter(MetricsReportingInfluxDbOptions options, ILineProtocolClient lineProtocolClient) : base(options, lineProtocolClient)
    {
    }
}

/// <summary>
/// Empty wrappper class of InfluxDbMetricsReporter to create a uniquely typed reporter.
/// </summary>
internal class UniqueReporter2InfluxDbReporter : InfluxDbMetricsReporter
{
    internal UniqueReporter2InfluxDbReporter(MetricsReportingInfluxDbOptions options, ILineProtocolClient lineProtocolClient) : base(options, lineProtocolClient)
    {
    }
}

@Havret
Copy link

Havret commented Jun 29, 2022

Hey @Francois-du-Plessis, thanks for your suggestion. It requires some boilerplate registration code, but works like a charm.

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.

3 participants