You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently working with my local Minikube environment and encountering difficulties in retrieving metrics from my application. I've gone through the instructions provided in Integrate Online Boutique with Google Cloud Operations. Could someone please guide me on how to expose metrics, traces, and logs to my local cluster? Your assistance would be greatly appreciated!
I revised otel-collector.yaml and kustomization.yaml like these below:
otel-collector.yaml
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: opentelemetrycollector
spec:
replicas: 1
selector:
matchLabels:
app: opentelemetrycollector
template:
metadata:
labels:
app: opentelemetrycollector
spec:
securityContext:
fsGroup: 1000
runAsGroup: 1000
runAsNonRoot: true
runAsUser: 1000
# Init container retrieves the current cloud project id from the metadata server
# and inserts it into the collector config template
# https://cloud.google.com/compute/docs/storing-retrieving-metadata
initContainers:
- name: otel-gateway-init
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
privileged: false
readOnlyRootFilesystem: true
image: busybox:latest@sha256:c3839dd800b9eb7603340509769c43e146a74c63dca3045a8e7dc8ee07e53966
command:
- '/bin/sh'
- '-c'
- cp /template/collector-gateway-config-template.yaml /conf/collector-gateway-config.yaml
# sed "s/{{PROJECT_ID}}/$(curl -H 'Metadata-Flavor: Google' http://metadata.google.internal/computeMetadata/v1/project/project-id)/" /template/collector-gateway-config-template.yaml >> /conf/collector-gateway-config.yaml
volumeMounts:
- name: collector-gateway-config-template
mountPath: /template
- name: collector-gateway-config
mountPath: /conf
containers:
# This gateway container will receive traces and metrics from each microservice
# and forward it to GCP
- name: otel-gateway
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
privileged: false
readOnlyRootFilesystem: true
args:
- --config=/conf/collector-gateway-config.yaml
image: otel/opentelemetry-collector-contrib:0.98.0@sha256:5cea85bcbc734a3c0a641368e5a4ea9d31b472997e9f2feca57eeb4a147fcf1a
volumeMounts:
- name: collector-gateway-config
mountPath: /conf
volumes:
# Simple ConfigMap volume with template file
- name: collector-gateway-config-template
configMap:
items:
- key: collector-gateway-config-template.yaml
path: collector-gateway-config-template.yaml
name: collector-gateway-config-template
# Create a volume to store the expanded template (with correct cloud project ID)
- name: collector-gateway-config
emptyDir: {}
---
apiVersion: v1
kind: Service
metadata:
name: opentelemetrycollector
spec:
ports:
- name: grpc-otlp
port: 4317
protocol: TCP
targetPort: 4317
selector:
app: opentelemetrycollector
type: ClusterIP
---
apiVersion: v1
kind: ConfigMap
metadata:
name: collector-gateway-config-template
# Open Telemetry Collector config
# https://opentelemetry.io/docs/collector/configuration/
data:
collector-gateway-config-template.yaml: |
receivers:
otlp:
protocols:
grpc:
processors:
exporters:
otlp:
endpoint: localhost:4317
prometheus:
endpoint: localhost:9090
namespace: monitoring
extensions:
health_check:
pprof:
zpages:
service:
extensions: [health_check, pprof, zpages]
pipelines:
# traces:
# receivers: [otlp]
# processors: []
# exporters: [otlp]
metrics:
receivers: [otlp]
processors: []
exporters: [prometheus]
# logs:
# receivers: [otlp]
# processors: []
# exporters: [otlp]
# receivers:
# otlp:
# protocols:
# grpc:
# processors:
# exporters:
# googlecloud:
# project: {{PROJECT_ID}}
# service:
# pipelines:
# traces:
# receivers: [otlp] # Receive otlp-formatted data from other collector instances
# processors: []
# exporters: [googlecloud] # Export traces directly to Google Cloud
# metrics:
# receivers: [otlp]
# processors: []
# exporters: [googlecloud] # Export metrics to Google Cloud
Write down your inquiry
I'm currently working with my local Minikube environment and encountering difficulties in retrieving metrics from my application. I've gone through the instructions provided in Integrate Online Boutique with Google Cloud Operations. Could someone please guide me on how to expose metrics, traces, and logs to my local cluster? Your assistance would be greatly appreciated!
I revised otel-collector.yaml and kustomization.yaml like these below:
otel-collector.yaml
kustomization.yaml
kube-prometheus was configured in default in monitoring namespace.
The text was updated successfully, but these errors were encountered: