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

Unable to Override the Host name #316

Open
EricSei opened this issue Jul 11, 2019 · 4 comments
Open

Unable to Override the Host name #316

EricSei opened this issue Jul 11, 2019 · 4 comments
Assignees

Comments

@EricSei
Copy link

EricSei commented Jul 11, 2019

I'm integrating the RollBar with python for our project that ran on Docker.
But I can't override the host name of Server. Rollbar is only reporting default host name. How can I change the host name ?

@EricSei EricSei changed the title Can not override the host name Unable to Override the Host name Jul 11, 2019
@brianr
Copy link
Member

brianr commented Jul 25, 2019

@EricSei Good quesiton... there's no great way to do this now, but here's an ugly one that should work:

Monkeypatch _build_server_data, e.g.:

import rollbar
orig_build_server_data = rollbar._build_server_data
def new_build_server_data():
    data = orig_build_server_data()
    data['host'] = 'my hostname value goes here'  # call a function to get this, etc.
    return data
rollbar._build_server_data = new_build_server_data

Will this work?

@EricSei
Copy link
Author

EricSei commented Jul 25, 2019

Thanks for your answer. I will try your code and keep you updated.

@gnpar
Copy link

gnpar commented Dec 7, 2022

Note that the official rollbar docs recommend setting the host for multiple production environments:

Recommended usage

Use the environment value production for all errors from and deploys to any production environment, even if you have multiple production environments.
Use the host property in your error payloads to include the 'full path' of the server where an error occurred, including the name of the region/zone, e.g. us-east-1-web02 for the server web-02 that is hosted in the us-east-1 region.

So this should probably be supported. I can work on a PR for this if you'd like.

@danielmorell
Copy link
Collaborator

@gnpar I agree that an update seems reasonable. Let me see what I can do.

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

No branches or pull requests

4 participants