--- apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: mastodon-metrics namespace: mastodon-application labels: app.kubernetes.io/name: mastodon app.kubernetes.io/component: monitoring spec: selector: matchLabels: app.kubernetes.io/name: mastodon app.kubernetes.io/component: web endpoints: - port: http path: /metrics interval: 30s scrapeTimeout: 10s scheme: http honorLabels: true relabelings: - sourceLabels: [__meta_kubernetes_pod_name] targetLabel: pod - sourceLabels: [__meta_kubernetes_pod_node_name] targetLabel: node - sourceLabels: [__meta_kubernetes_namespace] targetLabel: namespace - sourceLabels: [__meta_kubernetes_service_name] targetLabel: service metricRelabelings: - sourceLabels: [__name__] regex: 'mastodon_.*' action: keep --- apiVersion: v1 kind: Service metadata: name: mastodon-web-metrics namespace: mastodon-application labels: app.kubernetes.io/name: mastodon app.kubernetes.io/component: web spec: type: ClusterIP ports: - name: http port: 3000 protocol: TCP targetPort: 3000 selector: app.kubernetes.io/name: mastodon app.kubernetes.io/component: web