Minio / S3 Service (TrueNAS-13.0-U3.1) Metrics

Richard Durso

Explorer
Joined
Jan 30, 2014
Messages
70
<div class="bbWrapper">I have Minio S3 Service working. It is configured to expose metrics endpoint and Prometheus is scraping it. I can see metrics within Prometheus UI.<br /> <br /> I'm trying to get the S3 Service build in dashboard to fetch metrics from an external Prometheus. The TrueNAS Core S3 service doesn't have native support it seems for providing the two environment variables needed to enable this <b>MINIO_PROMETHEUS_URL</b> and <b>MINIO_PROMETHEUS_JOB_ID</b>.<br /> <br /> <b>MINIO_PROMETHEUS_URL=https://k3s.[REDACTED].com/prometheus/<br /> MINIO_PROMETHEUS_JOB_ID=minio-job-truenas</b><br /> <br /> So I'm poking around...<br /> <br /> First I can CURL from TrueNAS to the remote Prometheus endpoint:<br /> <blockquote data-attributes="" data-quote="" data-source="" class="bbCodeBlock bbCodeBlock--expandable bbCodeBlock--quote js-expandWatch"> <div class="bbCodeBlock-content"> <div class="bbCodeBlock-expandContent js-expandContent "> root@truenas[~]# curl -XGET -G 'https://k3s.[REDACTED].com/prometheus/api/v1/label/__name__/values' --data-urlencode 'match[]={__name__=~&quot;.+&quot;, job=&quot;minio-job-truenas&quot;}'<br /> <br /> {&quot;status&quot;:&quot;success&quot;,&quot;data&quot;:[&quot;ALERTS&quot;,&quot;ALERTS_FOR_STATE&quot;,&quot;count:up0&quot;,&quot;count:up1&quot;,&quot;minio_bucket_objects_size_distribution&quot;,&quot;minio_bucket_replication_received_bytes&quot;,&quot;minio_bucket_usage_object_total&quot;,&quot;minio_bucket_usage_total_bytes&quot;,&quot;minio_cluster_disk_free_inodes&quot;,&quot;minio_cluster_nodes_offline_total&quot;,&quot;minio_cluster_nodes_online_total&quot;,&quot;minio_inter_node_traffic_errors_total&quot;,&quot;minio_inter_node_traffic_received_bytes&quot;,&quot;minio_inter_node_traffic_sent_bytes&quot;,&quot;minio_node_disk_free_bytes&quot;,&quot;minio_node_disk_total_bytes&quot;,&quot;minio_node_disk_used_bytes&quot;,&quot;minio_node_go_routine_total&quot;,&quot;minio_node_ilm_expiry_pending_tasks&quot;,&quot;minio_node_ilm_transition_active_tasks&quot;,&quot;minio_node_ilm_transition_pending_tasks&quot;,&quot;minio_node_ilm_versions_scanned&quot;,&quot;minio_node_scanner_bucket_scans_finished&quot;,&quot;minio_node_scanner_bucket_scans_started&quot;,&quot;minio_node_scanner_directories_scanned&quot;,&quot;minio_node_scanner_objects_scanned&quot;,&quot;minio_node_scanner_versions_scanned&quot;,&quot;minio_s3_requests_errors_total&quot;,&quot;minio_s3_requests_inflight_total&quot;,&quot;minio_s3_requests_rejected_auth_total&quot;,&quot;minio_s3_requests_rejected_header_total&quot;,&quot;minio_s3_requests_rejected_invalid_total&quot;,&quot;minio_s3_requests_rejected_timestamp_total&quot;,&quot;minio_s3_requests_total&quot;,&quot;minio_s3_requests_waiting_total&quot;,&quot;minio_s3_time_ttfb_seconds_distribution&quot;,&quot;minio_s3_traffic_received_bytes&quot;,&quot;minio_s3_traffic_sent_bytes&quot;,&quot;minio_software_commit_info&quot;,&quot;minio_software_version_info&quot;,&quot;minio_usage_last_activity_nano_seconds&quot;,&quot;promhttp_metric_handler_requests_in_flight&quot;,&quot;promhttp_metric_handler_requests_total&quot;,&quot;scrape_duration_seconds&quot;,&quot;scrape_samples_post_metric_relabeling&quot;,&quot;scrape_samples_scraped&quot;,&quot;scrape_series_added&quot;,&quot;up&quot;]}# </div> <div class="bbCodeBlock-expandLink js-expandLink"><a role="button" tabindex="0">Click to expand...</a></div> </div> </blockquote><br /> I tried exporting the variables within <b>/usr/local/etc/rc.d/minio</b> such as:<br /> <br /> <blockquote data-attributes="" data-quote="" data-source="" class="bbCodeBlock bbCodeBlock--expandable bbCodeBlock--quote js-expandWatch"> <div class="bbCodeBlock-content"> <div class="bbCodeBlock-expandContent js-expandContent "> : ${minio_prometheus_url=&quot;https://k3s.[REDACTED].com/prometheus/&quot;}<br /> : ${minio_prometheus_job=&quot;minio-job-truenas&quot;}<br /> ...<br /> # Insert these for Minio<br /> export MINIO_PROMETHEUS_URL=${minio_prometheus_url}<br /> export MINIO_PROMETHEUS_JOB_ID=${minio_prometheus_job}<br /> <br /> pidfile=&quot;/var/run/${name}.pid&quot;<br /> procname=&quot;/usr/local/bin/minio&quot;<br /> command=&quot;/usr/sbin/daemon&quot;<br /> command_args=&quot;-f -t ${name} ${minio_syslog_output_flags} -p ${pidfile} /usr/bin/env ${minio_env} ${procname} ${minio_config_flag} -S \&quot;${mi<br /> nio_certs}\&quot; --quiet server --address=\&quot;${minio_address}\&quot; ${minio_console_address_arg} ${minio_disks} ${minio_args}&quot;<br /> ... </div> <div class="bbCodeBlock-expandLink js-expandLink"><a role="button" tabindex="0">Click to expand...</a></div> </div> </blockquote><br /> Restarted the S3 service and the Minio Dashboard detects the Environment variables are set, and now displays:<br /> <blockquote data-attributes="" data-quote="" data-source="" class="bbCodeBlock bbCodeBlock--expandable bbCodeBlock--quote js-expandWatch"> <div class="bbCodeBlock-content"> <div class="bbCodeBlock-expandContent js-expandContent "> We can't retrieve advanced metrics at this time<br /> MinIO Dashboard will display basic metrics as we couldn't connect to Prometheus successfully.<br /> <br /> Please try again in a few minutes. If the problem persists, you can review your configuration and confirm that Prometheus server is up and running. </div> <div class="bbCodeBlock-expandLink js-expandLink"><a role="button" tabindex="0">Click to expand...</a></div> </div> </blockquote><br /> The MinIO / Tools / Logs:<br /> <blockquote data-attributes="" data-quote="" data-source="" class="bbCodeBlock bbCodeBlock--expandable bbCodeBlock--quote js-expandWatch"> <div class="bbCodeBlock-content"> <div class="bbCodeBlock-expandContent js-expandContent "> API: SYSTEM<br /> Time: 19:12:06:0<br /> DeploymentID: 2a488c37-8e1b-401a-beda-b22910187c88<br /> Error: readlink /proc/self: no such file or directory (*fs.PathError)<br /> internal/logger/logonce.go:52:logger.(*logOnceType).logOnceIf()<br /> internal/logger/logonce.go:92:logger.LogOnceIf()<br /> cmd/metrics-v2.go:891:cmd.getMinioProcMetrics.func1()<br /> cmd/metrics-v2.go:224:cmd.(*MetricsGroup).RegisterRead.func1.1()<br /> cmd/metrics-v2.go:236:cmd.(*MetricsGroup).Get()<br /> cmd/metrics-v2.go:1737:cmd.populateAndPublish()<br /> cmd/metrics-v2.go:1702:cmd.ReportMetrics.func1() </div> <div class="bbCodeBlock-expandLink js-expandLink"><a role="button" tabindex="0">Click to expand...</a></div> </div> </blockquote><br /> Not sure what else to try, don't see any options for more verbose logging.</div>
 
Top