"call to ExecQuery 'INSERT INTO users (userID, name, age) VALUES ($1, $2, $3)' with args [{Name: Ordinal:1 Value:eb52f5b9-d555-487c-b6a3-9456ee346734} {Name: Ordinal:2 Value:name1} {Name: Ordinal:3 Value:10}], was not expected, next expectation is: ExpectedPrepare => expecting Prepare statement which:
- matches sql: 'INSERT INTO users \(userID, name, age\) VALUES \(\?, \?, \?\)'"
apiVersion: v1
kind: Service
metadata:
name: http-monitor-svc
labels:
app: http-http
release: stable
annotations:
prometheus.io/scrape: "true"
prometheus.io/scheme: http
prometheus.io/path: /posts/metrics
prometheus.io/port: "8085"
namespace: default
spec:
ports:
- name: http-http
port: 8085
protocol: TCP
selector:
app: http-http
release: stable
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: http-monitor
labels:
app: http-http
release: stable
namespace: default
spec:
jobLabel: myCounter
selector:
matchLabels:
app: http-http
release: stable
namespaceSelector:
matchNames:
- default
endpoints:
- port: http-http
apiVersion: v1
kind: Service
metadata:
creationTimestamp: "2021-10-18T10:24:47Z"
labels:
operated-prometheus: "true"
name: prometheus-operated
namespace: default
ownerReferences:
- apiVersion: monitoring.coreos.com/v1
kind: Prometheus
name: stable-kube-prometheus-sta-prometheus
uid: 207dad67-f0c1-4f3e-aaa2-02a2dc00c5b5
resourceVersion: "73545"
uid: cfdd1fcb-ed93-425b-857f-3179ed60c79e
spec:
clusterIP: None
clusterIPs:
- None
internalTrafficPolicy: Cluster
ipFamilies:
- IPv4
ipFamilyPolicy: SingleStack
ports:
- name: web
port: 9090
protocol: TCP
targetPort: web
selector:
app.kubernetes.io/name: prometheus
sessionAffinity: None
type: ClusterIP
status:
loadBalancer: {}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
annotations:
meta.helm.sh/release-name: stable
meta.helm.sh/release-namespace: default
creationTimestamp: "2021-10-18T10:24:23Z"
generation: 1
labels:
app: kube-prometheus-stack-operator
app.kubernetes.io/instance: stable
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/part-of: kube-prometheus-stack
app.kubernetes.io/version: 19.1.0
chart: kube-prometheus-stack-19.1.0
heritage: Helm
release: stable
name: stable-kube-prometheus-sta-operator
namespace: default
resourceVersion: "73424"
uid: 3a7c543b-6023-4c06-899b-94c07edc132a
spec:
endpoints:
- honorLabels: true
port: https
scheme: https
tlsConfig:
ca:
secret:
key: ca
name: stable-kube-prometheus-sta-admission
optional: false
serverName: stable-kube-prometheus-sta-operator
namespaceSelector:
matchNames:
- default
selector:
matchLabels:
app: kube-prometheus-stack-operator
release: stable
apiVersion: v1
kind: Service
metadata:
name: http-monitor-svc
labels:
app: http-monitor-svc
kube-prometheus-stack-operator: http-monitor-svc
app.kubernetes.io/instance: stable
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/part-of: kube-prometheus-stack
app.kubernetes.io/version: 19.1.0
release: stable
annotations:
prometheus.io/scrape: "true"
prometheus.io/path: /posts/metrics
prometheus.io/port: "8085"
namespace: default
spec:
ports:
- name: http-http #ссылается на deployment моего сервиса, который собирает метрики по пути :8085/posts/metric
port: 8090
targetPort: 8085
protocol: TCP
selector:
app: http-http
release: stable
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: http-monitor
labels:
app: http-monitor-svc
app.kubernetes.io/instance: stable
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/part-of: kube-prometheus-stack
app.kubernetes.io/version: 19.1.0
release: stable
namespace: default
spec:
jobLabel: myCounter
selector:
matchLabels:
app: http-monitor-svc
release: stable
namespaceSelector:
matchNames:
- default
endpoints:
- port: http-monitor-svc
interval: 10s
path: /posts/metrics
apiVersion: apps/v1
kind: Deployment
metadata:
name: http-http-deployment
annotations:
prometheus.io/scrape: "true"
prometheus.io/path: /posts/metrics
prometheus.io/port: "8085"
labels:
app: http-http
spec:
replicas: 1
selector:
matchLabels:
app: http-http
template:
metadata:
annotations:
prometheus.io/scrape: "true"
prometheus.io/path: /posts/metrics
prometheus.io/port: "8085"
labels:
app: http-http
release: stable
spec:
containers:
- name: http-http
image: stasbigunenko/http_http
env:
- name: PORT_HTTP
value: ":8085"
- name: GRPC
value: "grpc-service:9000"
ports:
- containerPort: 8085
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis-deployment
labels:
app: redis
spec:
replicas: 1
selector:
matchLabels:
app: redis
template:
metadata:
labels:
app: redis
spec:
containers:
- name: redis
image: redis
env:
- name: REDIS_ADDR
value: ":6379"
ports:
- containerPort: 6379
apiVersion: v1
kind: Service
metadata:
name: redis-service
spec:
selector:
app: redis
ports:
- protocol: TCP
port: 6379
apiVersion: apps/v1
kind: Deployment
metadata:
name: http-grpc-deployment
labels:
app: http-grpc
spec:
replicas: 1
selector:
matchLabels:
app: http-grpc
template:
metadata:
labels:
app: http-grpc
spec:
containers:
- name: http-grpc
image: stasbigunenko/http_grpc
env:
- name: TCP_PORT
value: ":9000"
- name: REDIS_ADDR
value: "redis-service:6379"
ports:
- containerPort: 9000
version: "3.1"
services:
http:
container_name: "http_pr"
build:
context: "./"
dockerfile: "./docker/http.Dockerfile"
ports:
- "8085:8085"
# links:
# - "grpc:grpc"
environment:
PORT_HTTP: ":8085"
GRPC: "grpc:9000"
grpc:
container_name: "grpc"
build:
context: "./"
dockerfile: "./docker/grpc.Dockerfile"
ports:
- "9000:9000"
environment:
TCP_PORT: ":9000"
grpc | {[http://elasticsearch:9200] map[] [] [] false false 0 false false 0s false false false false <nil> <nil> <nil> <nil> <nil>}
grpc | 2021/10/06 07:54:24 Error getting response: dial tcp 172.19.0.3:9200: connect: connection refused
grpc | {[http://localhost:9200] map[] [] [] false false 0 false false 0s false false false false <nil> <nil> <nil> <nil> <nil>}
grpc | 2021/10/06 05:33:55 Error getting response: dial tcp 127.0.0.1:9200: connect: connection refused
Спасибо за подсказку.
У меня получилось решение чу-чуть другим. Я просто замокал сам ID
Вот так вот у меня заработало: