Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config_file system property not working #17

Open
fate-cheryl opened this issue Dec 1, 2021 · 4 comments
Open

config_file system property not working #17

fate-cheryl opened this issue Dec 1, 2021 · 4 comments

Comments

@fate-cheryl
Copy link

Hello, I was able to get my Mulesoft project working with system properties but when I am trying to use the elastic.apm.config_file property and reference all the configs in that file, I ran into two issues where it either cannot find the file or it cannot read from the file at all.

For the first issue, I first tried to add the property file in my resource file. In the system property I referenced it as a relative path but it couldn't find it. Then, I put it in the root of the project and it looks like it can find that file because i got a different error that it cannot find the localhost server_url. In my file, I have it referenced to Elastic Cloud server_url.

Do you have a sample project where you got the config_file working? Also, does it need to be called elasticapm.properties? I read in the Elastic documentation that it was expecting that. Secondly, I had my other config files in yaml. Can it point to a yaml file instead of.properties?

Lastly, thank you sooo much for developing this custom agent!!! It has been very useful for my company :)

@michaelhyatt
Copy link
Owner

Hi @fate-cheryl

Thanks for the compliment, glad the agent is useful.

As for the properties, the examples in this repo use system properties, as per defined here:

https://docs.mulesoft.com/mule-runtime/4.4/configuring-properties#system-properties

Can you try and load the property file using the configuration-properties element in your flow file?

<configuration-properties file="smtp.yaml"/>

The example page above says it should be possible.

If it doesn't work, I'll try to put together an example project for you.

@fate-cheryl
Copy link
Author

fate-cheryl commented Dec 6, 2021

hi @michaelhyatt, I've definitely tried that:

YAML:
yaml1

yaml2

Properties:
properties1

properties2

Note that I have these dependencies in my pom:

image

I actually did manage to get this to work by storing the properties file locally on my C: drive and referencing the full path. This was what I read in the elastic documentation:

image

I don't think the config_file system property can be supported in Mulesoft then, correct?

@michaelhyatt
Copy link
Owner

Had another look at it and indeed the only way to configure the properties with v0.4.0 is to use the Java system properties in the studio through -M-D flag, as described in the README. It seems to be a bug in how the Mule agent initialises the properties looking only at system properties overriding all other settings.

Will look into fixing it.

@fate-cheryl
Copy link
Author

Thanks for the confirmation, @michaelhyatt

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

No branches or pull requests

2 participants