Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Spring Metrics doesn't support Spring Expression Lanuage #81

Open
404pilot opened this issue Jun 25, 2014 · 8 comments
Open

Spring Metrics doesn't support Spring Expression Lanuage #81

404pilot opened this issue Jun 25, 2014 · 8 comments

Comments

@404pilot
Copy link

Just added port="#{appProperties['graphite.port']}" in applicationContext-metrics.xml. However, the metrics-spring will first validate port field and then throw an exception about failure validation. I checked the code in line 220 of AbstractReporterElementParser, it turns out the SpEL is not supported, since "^\\$\\{.*\\}$" is just a placeholder regex. It could be nice if SpEl is supported.

@ryantenney
Copy link
Owner

I don't see any reason why this shouldn't work. I'll give it a shot and get back to you.

@404pilot
Copy link
Author

@ryantenney SpEl starts with # which doesn't match regex ^\\$\\{.*\\}$

@ryantenney
Copy link
Owner

Yea, I understood that part of it. What I meant was I don't see any reason why it wouldn't be possible to enable SpEL. Sorry for the misunderstanding.

@404pilot
Copy link
Author

@ryantenney Sorry I am not sure I understood your question:) During the initialization of application, metrics-spring will first validate the port number by using regex pattern ^\\$\\{.*\\}$ and find out SpEl doesn't match. At this point, SpEl haven't been translated into actual value.

@netwein
Copy link

netwein commented Oct 26, 2014

I think SpEl should be also be implemented for metric's name

@ryantenney
Copy link
Owner

I attempted to fix this by changing the regex to [$#]\{.*\}, but Spring still doesn't resolve the SpEL. I'll keep working on it.

@ryantenney
Copy link
Owner

SpEL has proven to be exceptionally difficult to support. I don't forsee being able to support this at any point in the near future. If anyone can help with this issue I would welcome the assistance.

@yangtao309
Copy link

this problem can be fix it ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants