Skip to content
This repository has been archived by the owner on Mar 26, 2019. It is now read-only.

Allow loading reporter settings from config #19

Closed
alhardy opened this issue Sep 18, 2017 · 4 comments
Closed

Allow loading reporter settings from config #19

alhardy opened this issue Sep 18, 2017 · 4 comments

Comments

@alhardy
Copy link
Collaborator

alhardy commented Sep 18, 2017

Dependency on Microsoft DI and Configuration has been removed by default, still require a way to load settings from config

@alhardy alhardy added this to the 2.0.0 milestone Oct 16, 2017
alhardy added a commit that referenced this issue Feb 5, 2018
…configuration.bind, this way a dependency on MS configuration is not needed within App Metrics
@alhardy
Copy link
Collaborator Author

alhardy commented Feb 5, 2018

Simplest approach is the following from an application point of view. This way AppMetrics doesn't need any custom configuration of sorts or a dependency on IConfiguration

var influxOptions = new MetricsReportingInfluxDbOptions();
configuration.GetSection(nameof(MetricsReportingInfluxDbOptions)).Bind(influxOptions);

...
 builder.Report.ToInfluxDb(influxOptions);
...

@alhardy alhardy closed this as completed Feb 5, 2018
@stukselbax
Copy link

Before finding this, I have read your docs, and haven't find the way to do this. It is worth adding to the documentation. Also it would be great if such things could be available out of the box.

@alhardy
Copy link
Collaborator Author

alhardy commented Jun 6, 2018

Cool, open a new issue?

@alhardy
Copy link
Collaborator Author

alhardy commented Jun 6, 2018

Feel free to PR to documentation

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

No branches or pull requests

2 participants