CDC not working using File mode on docker

I am trying to setup the CDC streaming on dgraph for File mode as mentioned:
https://dgraph.io/docs/enterprise-features/change-data-capture/#enable-cdc-with-file-sink

I am trying it on local using docker compose file. I have created a file named, cdc inside of the same directory where the compose file is and running alpha with --cdc "file=./cdc" flag. I am not able to see any events there after inserting data.

for reference below is my docker-compose file:

  zero:
    image: dgraph/dgraph:v21.03.1
    ports:
      - 5080:5080
      - 6080:6080
    restart: on-failure
    command: dgraph zero --my=zero:5080
    volumes:
      - pcc-go-dbs:/dgraph
  alpha:
    image: dgraph/dgraph:v21.03.1
    ports:
      - 8080:8080
      - 9080:9080
    restart: on-failure
    command: dgraph alpha --my=alpha:7080 --zero=zero:5080 --security whitelist=0.0.0.0/0 --cdc "file=./cdc"
    volumes:
      - pcc-go-dbs:/dgraph
  ratel:
    image: dgraph/ratel:latest
    ports:
      - 8000:8000
    command: dgraph-ratel

please let me know what can i do to solve it.

You haven’t mounted your local file system’s . directory. I’m guessing you’ll find that file (cdc) inside the pcc-go-dbs folder.

Thanks for pointing out. now I can able to the log file.

But there is another issue with the events being logged there, for example below is the sample event:

{ "key": "0", "value": {"meta":{"commit_ts":129},"type":"mutation","event":{"operation":"set","uid":6700001,"attr":"display_name","value":"nath rofl","value_type":"string"}}}

it says "attr":"display_name" but instead is should be "attr":"user.display_name" where user is the type. currently it simply says display_name but how would the the consumer of this event would know to which type does it belongs?

can u please help me out.

Can you show the schema section that defines user.display_name?

Need to show schema AND if possible the mutation that caused this effect. I would dare say that the DQL mutation might not be using the type dotted notation.

@matthewmcneely

The schema does not defines node attributes as user.display_name. we directly defines it as display_name.

We are using DQL and yes, @amaster507 we dont use type dotted notation. Heres the schema:

type User {
   middle_names
   display_name
   created_at
   updated_at
}
middle_names: [string] .
display_name: string @index(trigram) .
created_at: dateTime @index(hour) .
updated_at: dateTime @index(hour) .

Then what it is producing is correct.

The type name context would only be there if the predicate was type contextualized which in your case it is not.

They wouldn’t. They would have to use the uid and get the dgraph.type predicate.

If you have to know the type context, then I would (if I were you) open an issue stating why you need the type context and request not that the predicate is always prefixed, but that the CDC always returns the dgraph.type predicate for context.