Giter Club home page Giter Club logo

newrelic-xamarin-binding's Introduction

New Relic Open Source archived project banner.

Archival Notice

❗Notice: This project has been archived as is and is no longer actively maintained.

New Relic has released an official Xamarin Agent: https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile-xamarin/monitor-your-xamarin-application/.

Please use this for monitoring your Xamarin applications.

New Relic Mobile Agent - Xamarin Bindings

Xamarin binding for New Relic mobile agents - iOS https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile-ios and Android SDK's https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile-android

Installation

The Xamarin binding depends on the mobile SDK's. There is a Makefile under ios and android directories that downloads the SDK's and builds the binding for iOS and Android.

Building and Getting Started for iOS and Android

iOS:

There is a Makefile for iOS that you can use (make) to build the NewRelicXamarin.iOS.dll that can be included in your Xamarin project. make will download a specific version of iOS SDK for New Relic Mobile, unzip the agent zip file and use it to build NewRelicXamarin.iOS.dll.

After the build is succesfull you need to add the NewRelicXamarin.iOS.dll file as a reference to your project. Make sure you add it in the iOS section.

Alternatively, you could use this project inside the Xamarian project and reference it.

  1. The Makefile uses Microsoft's build tool, msbuild (as xbuild is getting deprecated and replaced by msbuild). You can replace it with xbuild (Xamarin's build tool) if you are on older version of Xamarin.

If you are still using xbuild, replace MONOXBUILD=/Library/Frameworks/Mono.framework/Commands/msbuild with MONOXBUILD=/Library/Frameworks/Mono.framework/Commands/xbuild

  1. Add the Newrelic license key and start up command in your Xamarin code after you reference this library.

Open AppDelegate.cs and add the following to the top of the file:

using NewRelicXamarin;

Next, inside the class AppDelegate you need to add the following to the FinishedLaunching function:

NRLogger.SetLogLevels((uint)NRLogLevels.All);
NewRelicXamarin.NewRelic.StartWithApplicationToken("new_relic_license_key");

Make sure you replace the new_relic_license_key with your own. You can find your own license key by creating a Mobile app within the New Relic UI. Go to Mobile > Add a new app > Choose your platform > Give your App a name > Your license key is now visible lower down the page.

  1. Launch the application and check the New Relic UI for instrumentation data. It can take a couple of minutes before it's visible.

Android:

  1. There is a Makefile for Android that you can use (make) to build the NewRelicXamarin.Android.dll that can be included in your Xamarin project. make will:

     a. Download a specific version of Android SDK for New Relic Mobile
    
     b. Unzip the agent zip file and use it to build NewRelicXamarin.Android.dll
    

After the build is succesfull you need to add the NewRelicXamarin.Android.dll file as a reference to your project. Make sure you add it in the Android section.

  1. Add the Newrelic license key and start up command in your Xamarin code after you reference this library.

In the MainActivity class or equivalent

var config = new NewRelicXamarin.Android.AgentConfiguration();
//config.ReportCrashes = true;
//config.ReportHandledExceptions = true;
//var log = new NewRelicXamarin.Android.Logging.DefaultAgentLog();
config.ApplicationToken = "new_relic_license_key";
NewRelicXamarin.Android.AndroidAgentImpl.Init(this, config);
NewRelicXamarin.Android.Agent.Start();

//Alternatively, you can also start the agent with higher log level (for debugging)
using NewRelicXamarin.Android;

var config = new NewRelicXamarin.Android.AgentConfiguration();
config.ReportCrashes = true;
config.ApplicationToken = "new_relic_license_key";

var newRelic = NewRelic
.WithApplicationToken("new_relic_license_key")
.WithLoggingEnabled(true).WithLogLevel(6);
AndroidAgentImpl.Init(this, config);

Make sure you replace the new_relic_license_key with your own. You can find your own license key by creating a Mobile app within the New Relic UI. Go to Mobile > Add a new app > Choose your platform > Give your App a name > Your license key is now visible lower down the page.

  1. Launch the application and check the New Relic UI for instrumentation data. It can take a couple of minutes before it's visible.

Contributing

We encourage your contributions to improve the New Relic Xamarin Binding! Keep in mind when you submit your pull request, you'll need to sign the CLA via the click-through using CLA-Assistant. You only have to sign the CLA one time per project. If you have any questions, or to execute our corporate CLA, required if your contribution is on behalf of a company, please drop us an email at [email protected].

License

newrelic-xamarin-binding is licensed under the Apache 2.0 License.

newrelic-xamarin-binding's People

Contributors

asllop avatar jbeveland27 avatar melissaklein24 avatar sschwartzman avatar vvydier avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

boundaryalarm

newrelic-xamarin-binding's Issues

[Repolinter] Open Source Policy Issues

Repolinter Report

πŸ€–This issue was automatically generated by repolinter-action, developed by the Open Source and Developer Advocacy team at New Relic. This issue will be automatically updated or closed when changes are pushed. If you have any problems with this tool, please feel free to open a GitHub issue or give us a ping in #help-opensource.

This Repolinter run generated the following results:

❗ Error ❌ Fail ⚠️ Warn βœ… Pass Ignored Total
0 3 1 2 0 6

Fail #

❌ readme-starts-with-experimental-header #

The README of an experimental project should have an experimental header at the start of the README. If you already have an experimental header and this rule is failing, your header may be out of date, and you should update your header with the suggested one below. For more information please visit https://opensource.newrelic.com/oss-category/. Below is a list of files or patterns that failed:

  • README.md: The first 5 lines do not contain the pattern(s): Open source experimental header (see https://opensource.newrelic.com/oss-category).
    • πŸ”¨ Suggested Fix: prepend the latest code snippet found at https://github.com/newrelic/opensource-website/wiki/Open-Source-Category-Snippets#code-snippet to file

❌ readme-contains-link-to-security-policy #

Doesn't contain a link to the security policy for this repository (README.md). New Relic recommends putting a link to the open source security policy for your project (https://github.com/newrelic-experimental/<repo-name>/security/policy or ../../security/policy) in the README. For an example of this, please see the "a note about vulnerabilities" section of the Open By Default repository. For more information please visit https://nerdlife.datanerd.us/new-relic/security-guidelines-for-publishing-source-code.

❌ code-of-conduct-should-not-exist-here #

New Relic has moved the CODE_OF_CONDUCT file to a centralized location where it is referenced automatically by every repository in the New Relic organization. Because of this change, any other CODE_OF_CONDUCT file in a repository is now redundant and should be removed. Note that you will need to adjust any links to the local CODE_OF_CONDUCT file in your documentation to point to the central file (README and CONTRIBUTING will probably have links that need updating). For more information please visit https://docs.google.com/document/d/1y644Pwi82kasNP5VPVjDV8rsmkBKclQVHFkz8pwRUtE/view. Found files. Below is a list of files or patterns that failed:

  • CODE_OF_CONDUCT.md
    • πŸ”¨ Suggested Fix: Remove file

Warning #

Click to see rules

⚠️ third-party-notices-file-exists #

A THIRD_PARTY_NOTICES.md file can be present in your repository to grant attribution to all dependencies being used by this project. This document is necessary if you are using third-party source code in your project, with the exception of code referenced outside the project's compiled/bundled binary (ex. some Java projects require modules to be pre-installed in the classpath, outside the project binary and therefore outside the scope of the THIRD_PARTY_NOTICES). Please review your project's dependencies and create a THIRD_PARTY_NOTICES.md file if necessary. For JavaScript projects, you can generate this file using the oss-cli. For more information please visit https://docs.google.com/document/d/1y644Pwi82kasNP5VPVjDV8rsmkBKclQVHFkz8pwRUtE/view. Did not find a file matching the specified patterns. Below is a list of files or patterns that failed:

  • THIRD_PARTY_NOTICES*
  • THIRD-PARTY-NOTICES*
  • THIRDPARTYNOTICES*

Passed #

Click to see rules

βœ… license-file-exists #

Found file (LICENSE). New Relic requires that all open source projects have an associated license contained within the project. This license must be permissive (e.g. non-viral or copyleft), and we recommend Apache 2.0 for most use cases. For more information please visit https://docs.google.com/document/d/1vML4aY_czsY0URu2yiP3xLAKYufNrKsc7o4kjuegpDw/edit.

βœ… readme-file-exists #

Found file (README.md). New Relic requires a README file in all projects. This README should give a general overview of the project, and should point to additional resources (security, contributing, etc.) where developers and users can learn further. For more information please visit https://github.com/newrelic/open-source-tools/tree/master/nerdpacks/oss-template.

Features not working on dashboard

I can see Android and iOS app on the dashboard but I notice the following:
Crashes are not working - I crash the app for both Android and iOS but no crushes recorded
HTTP errors and network failure rate is not working in Android but is working in iOS
App Launches is working for both Android and iOS
HTTP response time is not working for Android but its working for iOS
Most frequent interactions is not working for Android but its working for iOS.
Handle exceptions is not working for both Android and iOS

New Relic Xamarin Binding for iOS cannot resolve runtime reference

I was able to implement the Xamarin Binding successfully in Android.

But iOS is a different story.

Description

My iOS App works well when compiled. But once rebuilt (for Distribution), it crashes when the application tries to start the agent: NewRelic.StartWithApplicationToken. The IDE reports this exception:

Method not found: IntPtr
CoreFoundation.CFString.CreateNative(string)

Steps to Reproduce

  1. Insert NewRelic.StartWithApplicationToken inside main's app delegate "FinishedLaunching" method.
  2. Rebuild.
  3. Install IPA on test device.
  4. Run.

Relevant Logs / Console output

I've attached some screenshots.
WhatsApp Image 2022-03-17 at 6 55 56 PM
WhatsApp Image 2022-03-17 at 5 06 13 PM

Your Environment

Xamarin project's minimum iOS version set to 10.3
Agent version is 6.14.0

XCFramework agent bindings

Hello NewRelic team,

do you have any plans to add bindings for the XCFramework agent in the near future?

Upgrade to use in MAUI

Summary

MAUI has been finally release and I'm interested in using NewRelic there. I know it's experimental, but looks like it's easier to use in MAUI.
Thanks in advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.