Mongo Proxy configuration issue

239 views
Skip to first unread message

Milind Torney

unread,
May 27, 2021, 5:18:23 PM5/27/21
to envoy-users
Hi All, 

Im trying to configure Mongo proxy and capture the mongo access logs.  Here is the configuration.  Somehow, this configuration is is not capturing any logs. Not sure, if this is configuration issue or issue with the mongo proxy. 

Here is the envoy configuration:
admin:
access_log_path: "/dev/null"
address:
socket_address:
address: 0.0.0.0
port_value: 8001
static_resources:
listeners:
- address:
socket_address:
address: 0.0.0.0
port_value: 27000
filter_chains:
- filters:
- name: envoy.filters.network.mongo_proxy
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.network.mongo_proxy.v3.MongoProxy
stat_prefix: "mongo"
emit_dynamic_metadata: true
access_log: /tmp/mongo_stats00.log
- name: envoy.tcp_proxy
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
stat_prefix: ingress_tcp0
cluster: mongos0
clusters:
- name: mongos0
connect_timeout: 0.25s
type: STATIC
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: mongos0
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: 172.17.0.2 #This is IP in the docker container
port_value: 27017


With above configuration, mongo queries works fine, but no logs are captured except following two lines.

{"time": "2021-05-27T20:37:23.728Z", "message": {"opcode": "OP_QUERY", "id": 45, "response_to": 0, "flags": "0x0", "collection": "admin.$cmd", "skip": 0, "return": 1, "query": {"isMaster": 1, "hostInfo": "C02F65AWMD6T:27017", "client": {"application": {"name": "MongoDB Shell"}, "driver": {"name": "MongoDB Internal Client", "version": "4.2.9"}, "os": {"type": "Darwin", "name": "Mac OS X", "architecture": "x86_64", "version": "19.6.0"}}}, "fields": {}}, "upstream_host": "172.17.0.2:27017"}

{"time": "2021-05-27T20:37:23.728Z", "message": {"opcode": "OP_REPLY", "id": 1237, "response_to": 45, "flags": "0x8", "cursor": "0", "from": 0, "returned": 1, "documents": 1}, "upstream_host": "172.17.0.2:27017"}


Any pointers will help. 

thanks
Milind  


Milind Torney

unread,
May 27, 2021, 5:20:06 PM5/27/21
to envoy-users
Attaching envoy.yaml for ref 
envoy.yaml

Milind Torney

unread,
Jun 9, 2021, 5:32:20 PM6/9/21
to envoy-users
Hi, Does anyone using Envoy for Mongo proxy? 

Wade Wilkins

unread,
Oct 26, 2021, 6:01:30 PM10/26/21
to envoy-users
Hi Milind,
Did you get a solution to this?
I am having same issue.

Thanks,
Wade

Milind Torney

unread,
Oct 26, 2021, 7:06:24 PM10/26/21
to Wade Wilkins, envoy-users
No, could not get this to work.
Please let me know if find anything

Thanks 


--
You received this message because you are subscribed to a topic in the Google Groups "envoy-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/envoy-users/ye3EsjfcIgo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to envoy-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/envoy-users/d074fb82-ad87-4dec-bf82-748f2c8c1574n%40googlegroups.com.

This electronic communication and the information and any files transmitted with it, or attached to it, are confidential and are intended solely for the use of the individual or entity to whom it is addressed and may contain information that is confidential, legally privileged, protected by privacy laws, or otherwise restricted from disclosure to anyone else. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, you are hereby notified that any use, copying, distributing, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. If you received this e-mail in error, please return the e-mail to the sender, delete it from your computer, and destroy any printed copy of it.
Reply all
Reply to author
Forward
0 new messages