Parameters | Description |
name | Exporter name, which should meet the following requirements: The name should be unique. The name should conform to the following regular expression: '^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$'. |
user | The username of OracleDB. |
password | The password of OracleDB. |
host | The service domain name of OracleDB. |
port | The service port of OracleDB. |
database | The database name of OracleDB. |
tag | Custom labels for metrics. |
apiVersion: v1kind: Secretmetadata:name: oracledb-secret-test # Adjust to the corresponding name based on business requirements.namespace: oracledb-demo # Adjust to the corresponding namespace based on business requirements.type: OpaquestringData:datasource: "oracle://test:123456/127.0.0.1:1521/ORCLPDB1" # Corresponds to the OracleDB connection string information.# test is the username, 123456 is the user password, 127.0.0.1 is the database IP or domain name, 1521 is the database port, and ORCLPDB1 is the database name.
apiVersion: apps/v1kind: Deploymentmetadata:labels:k8s-app: oracledb-exporter # Adjust to the corresponding name based on business requirements. It is recommended to include information about the OracleDB instance.name: oracledb-exporter # Adjust to the corresponding name based on business requirements. It is recommended to include information about the OracleDB instance.namespace: oracledb-demo # Adjust to the corresponding namespace based on business requirements.spec:replicas: 1selector:matchLabels:k8s-app: oracledb-exporter # Adjust to the corresponding name based on business requirements. It is recommended to include information about the OracleDB instance.template:metadata:labels:k8s-app: oracledb-exporter # Adjust to the corresponding name based on business requirements. It is recommended to include information about the OracleDB instance.spec:containers:- args:- --web.listen-address=:8080envFrom:- secretRef:name: oracledb-secret-test # The name of the Secret created in the previous step.image: ccr.ccs.tencentyun.com/rig-agent/common-image:oracledb-exporter-v0.6.0-alpineimagePullPolicy: IfNotPresentname: oracledb-exporterports:- containerPort: 8080name: metricsprotocol: TCPterminationMessagePath: /dev/termination-logterminationMessagePolicy: FilednsPolicy: ClusterFirstimagePullSecrets:- name: qcloudregistrykeyrestartPolicy: AlwaysschedulerName: default-schedulersecurityContext: {}terminationGracePeriodSeconds: 30
wget -qO- http://localhost:8080/metrics
PodMonitor
via service discovery to define the collection task. The YAML example is as follows:apiVersion: monitoring.coreos.com/v1kind: PodMonitormetadata:name: oracledb-exporter # Enter a unique name.namespace: cm-prometheus # Pay-as-you-go instance: Use the namespace of the cluster. Monthly subscription instance (no longer available): The namespace is fixed. Do not change it.spec:podMetricsEndpoints:- interval: 30sport: metric-port # Enter the port of the Prometheus Exporter in the Pod YAML file.path: /metrics # Enter the path of the Prometheus Exporter. Default value: /metrics.relabelings:- action: replacesourceLabels:- instanceregex: (.*)targetLabel: instancereplacement: 'crs-xxxxxx' # Replace with the corresponding OracleDB instance ID.namespaceSelector: # Select the namespace where the OracleDB Exporter pod to be monitored is located.matchNames:- oracledb-demoselector: # Enter the labels of the Pod to be monitored to locate the target Pod.matchLabels:k8s-app: oracledb-exporter
Name | Description |
web.telemetry-path | Path for exposing metrics. Default value /metrics . |
web.systemd-socket | Use a systemd socket listener instead of a port listener (Linux only). |
web.listen-address | Listening address. The default address is 9161. |
web.config.file | The path to the configuration file, which can enable TLS or authentication. |
log.level | The log level. Available options are debug, info, warn, error, and fatal. |
log.format | The output format of log messages. For example, logger:syslog?appname=bob&local=7 or logger:stdout?json=true. The default output format is stderr. |
custom.metrics | Path to the custom metric configuration. |
default.metrics | The default path for metric configuration. |
database.maxIdleConns | Maximum number of idle connections. The default value is 0. |
database.maxOpenConns | Maximum number of open connections. The default value is 0. |
database.dsn | Database DSN string. |
database.dsnFile | File containing the DSN string. |
query.timeout | Timeout for collection queries. The default value is 5 seconds. |
scrape.interval | Configuration for the scraping interval. |
Was this page helpful?