couchdb icon indicating copy to clipboard operation
couchdb copied to clipboard

Distinguish updates

Open iilyak opened this issue 4 years ago • 0 comments

Overview

This PR allow us to distinguish between new doc and update of the existent doc for tracing.

Testing recommendations

  1. update rel/overlay/etc/default.ini as follows
rel/overlay/etc/default.ini
[tracing]
enabled = true ; true | false
app_name = couchdb ; value to use for the `location.application` tag
protocol = http ; udp | http - which reporter to use
endpoint = http://127.0.0.1:14268
 
[tracing.filters]
all = (#{}) -> true
  1. start jaeger in docker container
docker run -d -p 6831:6831/udp -p 16686:16686 -p 14268:14268 jaegertracing/all-in-one:1.14
  1. Start couchdb dev/run --admin=adm:pass --no-join
  2. Create database curl -X PUT -u adm:pass http://127.0.0.1:15984/test
  3. Create document curl -X PUT -u adm:pass http://127.0.0.1:15984/test -H Content-Type:application/json -d '{"_id":"doc1"}'
  4. Update document curl -X PUT -u adm:pass "http://127.0.0.1:15984/test/doc1?rev=8-4f98b201f7a6f147a952fe70651f0a95" -H Content-Type:application/json -d '{"_id":"doc1","val": 4}'
  5. Update document curl -X PUT -u adm:pass "http://127.0.0.1:15984/test/doc1" -H Content-Type:application/json -d '{"_id":"doc1","dfd": 4, "_rev": "11-fdcab8b70c87eb64255f504a5d983ab0"}'
  6. Open http://localhost:16686/ in the browser and search for spans (you should find some traces)
    • the first event should have action equal to db.doc.write
    • the second event should have action equal to db.doc.update
    • the third event should have action equal to db.doc.update

Related Issues or Pull Requests

N/A

Checklist

  • [x] Code is written and works correctly
  • [ ] Changes are covered by tests
  • [ ] Any new configurable parameters are documented in rel/overlay/etc/default.ini
  • [ ] A PR for documentation changes has been made in https://github.com/apache/couchdb-documentation

iilyak avatar Apr 21 '20 17:04 iilyak