File tree 5 files changed +64
-23
lines changed
5 files changed +64
-23
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ public static void Main(string[] args)
18
18
{
19
19
Metrics = AppMetrics . CreateDefaultBuilder ( )
20
20
. OutputMetrics . AsPrometheusPlainText ( )
21
- . OutputMetrics . AsPrometheusProtobuf ( )
21
+ // .OutputMetrics.AsPrometheusProtobuf()
22
22
. Build ( ) ;
23
23
24
24
@@ -54,8 +54,8 @@ public static IWebHostBuilder CreateWebHostBuilder(string[] args)
54
54
{
55
55
options . EndpointOptions = endpointsOptions =>
56
56
{
57
- endpointsOptions . MetricsTextEndpointOutputFormatter = Metrics . OutputMetricsFormatters . OfType < MetricsPrometheusTextOutputFormatter > ( ) . First ( ) ;
58
- endpointsOptions . MetricsEndpointOutputFormatter = Metrics . OutputMetricsFormatters . OfType < MetricsPrometheusProtobufOutputFormatter > ( ) . First ( ) ;
57
+ // endpointsOptions.MetricsTextEndpointOutputFormatter = Metrics.OutputMetricsFormatters.OfType<MetricsPrometheusTextOutputFormatter>().First();
58
+ endpointsOptions . MetricsEndpointOutputFormatter = Metrics . OutputMetricsFormatters . OfType < MetricsPrometheusTextOutputFormatter > ( ) . First ( ) ;
59
59
} ;
60
60
} )
61
61
. UseStartup < Startup > ( ) ;
Original file line number Diff line number Diff line change 12
12
<PackageReference Include =" Microsoft.Extensions.Logging.Console" Version =" 2.2.0" />
13
13
<PackageReference Include =" Microsoft.Extensions.Logging.Debug" Version =" 2.2.0" />
14
14
<PackageReference Include =" Microsoft.Extensions.Logging.EventLog" Version =" 2.2.0" />
15
- <PackageReference Include =" Super.Package.Configuration.ConfigServer.Abstractions" Version =" 1.0.2" />
16
15
<PackageReference Include =" System.Configuration.Abstractions" Version =" 2.0.2.45" />
17
16
</ItemGroup >
18
17
Original file line number Diff line number Diff line change @@ -78,4 +78,26 @@ services:
78
78
- " 15672:15672"
79
79
environment :
80
80
RABBITMQ_DEFAULT_USER : guest
81
- RABBITMQ_DEFAULT_PASS : guest
81
+ RABBITMQ_DEFAULT_PASS : guest
82
+
83
+ prom :
84
+ image : quay.io/prometheus/prometheus:v2.0.0
85
+ volumes :
86
+ - ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
87
+ command : " --config.file=/etc/prometheus/prometheus.yml --storage.tsdb.path=/prometheus"
88
+ ports :
89
+ - 9090:9090
90
+ depends_on :
91
+ - exporter
92
+ exporter :
93
+ image : prom/node-exporter:latest
94
+ ports :
95
+ - " 9100:9100"
96
+ grafana :
97
+ image : grafana/grafana
98
+ ports :
99
+ - " 3000:3000"
100
+ environment :
101
+ - GF_INSTALL_PLUGINS=grafana-piechart-panel
102
+ depends_on :
103
+ - prom
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- # prometheus.yml
1
+ # my global config
2
2
global :
3
- scrape_interval : 5s
4
- external_labels :
5
- monitor : ' my-monitor'
3
+ scrape_interval : 15s # By default, scrape targets every 15 seconds.
4
+ evaluation_interval : 15s # By default, scrape targets every 15 seconds.
5
+ # scrape_timeout is set to the global default (10s).
6
+
7
+ # Attach these labels to any time series or alerts when communicating with
8
+ # external systems (federation, remote storage, Alertmanager).
9
+ external_labels :
10
+ monitor : ' codelab-monitor'
11
+
12
+ # Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
13
+ rule_files :
14
+ # - "first.rules"
15
+ # - "second.rules"
16
+
17
+ # A scrape configuration containing exactly one endpoint to scrape:
18
+ # Here it's Prometheus itself.
6
19
scrape_configs :
7
- - job_name : ' prometheus'
8
- target_groups :
9
- - targets : ['localhost:9090']
20
+ # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
21
+ - job_name : ' prometheus'
22
+
23
+ # Override the global default and scrape targets from this job every 5 seconds.
24
+ scrape_interval : 5s
25
+
26
+ # metrics_path defaults to '/metrics'
27
+ # scheme defaults to 'http'.
28
+
29
+ static_configs :
30
+ - targets : ['localhost:9090']
31
+
32
+ - job_name : " node"
33
+ scrape_interval : " 15s"
34
+ static_configs :
35
+ - targets : ['exporter:9100']
36
+
37
+ - job_name : " webapi"
38
+ scrape_interval : 5s
39
+ static_configs :
40
+ - targets : ['web']
You can’t perform that action at this time.
0 commit comments