nlopes / actix-web-prom

Actix-web middleware to expose Prometheus metrics
MIT License
89 stars 56 forks source link

can't use actix-web-prom with actix-web 4 #56

Closed abdelmonem17 closed 3 years ago

abdelmonem17 commented 3 years ago

hello everyone I am tring to use use actix-web-prom with actix-web 4 whith the below dependency

actix-web = {git = "https://github.com/actix/actix-web",version ="4.0.0-beta.8"} actix-web-prom = { git = "https://github.com/arthurlm/actix-web-prom.git", branch = "actix-next" }

but I got the following error

not all trait items implemented, missing: Error --> C:\Users\AbdelmonemMohamed.cargo\git\checkouts\actix-web-prom-af77977b77662c26\a23d5a6\src\lib.rs:589:1 589 impl MessageBody for StreamLog { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing Error in implementation
= help: implement the missing item: `type Error = Type;`

please any help

arthurlm commented 3 years ago

Hi,

I have synchronize branch names in my repository following branch name in actix-web repository. So you should try setting your Cargo.toml as bellow:

actix-web = "4.0.0-beta.8"
actix-web-prom = { git = "https://github.com/arthurlm/actix-web-prom.git", branch = "actix-web-4.0.0-beta8" }

Indeed comment in issue #51 is a little bit outdated.

abdelmonem17 commented 3 years ago

could you try this ? actix-web = {git = "https://github.com/actix/actix-web",version ="4.0.0-beta.8"} actix-web-prom = { git = "https://github.com/arthurlm/actix-web-prom.git", branch = "actix-web-4.0.0-beta8" }

arthurlm commented 3 years ago

It should also works.


From my understanding:

 actix-web = {git = "https://github.com/actix/actix-web",version ="4.0.0-beta.8"}

and:

 actix-web = "4.0.0-beta.8"

should do exactly the same thing, since actix-web default git registered repository is https://github.com/actix/actix-web. So it is up to you for setting this config in your dependencies.

abdelmonem17 commented 3 years ago

this not work

actix-web = {git = "https://github.com/actix/actix-web",version ="4.0.0-beta.8"}

but thank you for help and I will try to use actix-web = "4.0.0-beta.8" in all projects

nlopes commented 3 years ago

I've now started a PR at https://github.com/nlopes/actix-web-prom/pull/57 to get actix-web-prom to have -beta.N versions as well, and at the same time align it to actix-web-beta.8.