Git Product home page Git Product logo

nr1-vscode-extension's Introduction

Community Project header

Badge for version for Visual Studio Code extension Installs Rating

New Relic VS Code extension

The Visual Studio Code Extension (VSCode) for New Relic helps developers build and deploy New Relic apps directly from VSCode. The extension allows you to use New Relic CLI commands to build custom apps, manage your apps, and gather the information you need to successfully add your app to the New Relic One Catalog. For reference materials, you can also open and search developer documentation directly in the CLI.

VS Code using NR1 extension

Table of contents

Prerequisites

Getting started

Features

  CLI commands

  Snippets

Contributing

  How to develop locally and contribute changes

License

Prerequisites

Before you start coding, be sure you've done the following:

  1. Create a free account

  2. Get your API key

  3. Install the nr1 CLI here

Note: A nerdpack will be created under the account associated with the current default profile

Getting started

  1. Install the extension from the VS Code Marketplace.
  2. Open the VS Code command palette (Ctrl+Shift+P in Windows/Linux or Cmd+Shift+P in macOS).
  3. Enter "New Relic" to get a list of the available commands.
  4. Select New Relic (profile): select default or New Relic (nerdpack): create a nerdpack to get started!

Features

These are the features currently supported by this extension.

CLI commands

Name Description
New Relic (profile): select default Choose your default profile ℹ️
New Relic (profile): add a new or existing profile Add a new or existing New Relic profile
New Relic (nerdpack): generate uuid Assign a new UUID to your Nerdpack ℹ️
New Relic (nerdpack): create a nerdpack Create a new component from a Nerdpack template ℹ️
New Relic (nerdpack): create a nerdlet Creates a new component from a Nerdlet template ℹ️
New Relic (nerdpack): create a launcher Create a new component from a Launcher template ℹ️
New Relic (nerdpack): run local development Launch a local server to test your Nerdpack on the New Relic One platform ℹ️
New Relic (nerdpack): publish Publishes your Nerdpack to New Relic ℹ️
New Relic (nerdpack): deploy Deploys a Nerdpack version to a specific channel (DEV, BETA, or STABLE). ℹ️
New Relic (nerdpack): undeploy Undeploys a Nerdpack version from a specific channel (for example, DEV, BETA, or STABLE) ℹ️
New Relic (nerdpack): subscribe account to nerdpack Subscribes your account to a specific Nerdpack and channel ℹ️
New Relic (nerdpack): unsubscribe account from nerdpack Unsubscribes your account from a specific Nerdpack ℹ️
New Relic (profile): show subscribed nerdpacks Lists all the Nerdpacks your account is subscribed to ℹ️
New Relic (nerdpack): create catalog listing Creates a new listing from the Catalog template ℹ️
New Relic (nerdpack): submit catalog listing Gathers the information you add to the catalog directory for your application and saves it to the New Relic One Catalog ℹ️
New Relic (nerdpack): show published catalog listing info Shows the information about your application that's displayed in the New Relic One Catalog. ℹ️
New Relic (docs): open developer documentation Go to developer.newrelic.com
New Relic (docs): search developer documentation Search through New Relic developer documentation

Snippets

There are snippets for each component listed on developer.newrelic.com, each trigger is preceded by NR1 to make them easy to access.

If you notice any components are missing please open an issue, or you can contribute the snippet yourself using the guidelines below.

Contributing

This project adheres to a Code of Conduct. Please read before contributing.

How to develop locally and contribute changes

  1. Fork this repository.
  2. Open project in VS Code.
  3. Hit F5 to compile and launch the extension in debug mode. This will open a new VS Code window in which you can open the Command Palette and try out the commands.
  4. Make your changes in a new branch.
  5. Commit and push your changes.
  6. Open a pull request with a description of the changes. Feel free to include anything that could make our review easier (screenshots, demo gifs, etc.).

License

This project is distributed under the Apache 2 license.

Known Issues

Report issues on our GitHub repository.

We also encourage pull requests if you want to help make the extension even better.

nr1-vscode-extension's People

Contributors

dependabot[bot] avatar julianocera avatar lizbaker avatar mbazhlekova avatar rudouglas avatar semantic-release-bot avatar tangollama avatar timglaser avatar veextee avatar zstix avatar

Stargazers

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

Watchers

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

nr1-vscode-extension's Issues

Verify approach to build VSCode extension is correct

Summary

Before we start adding new features, let's verify that the approach Russ took when building the VSCode Extension is alright. Specifically, we want to find out if using child_process from node is okay.

Desired Behavior

Possible Solution

Talk to Jordi about doing a code review since he has built a VSCode Extension before.

Additional context

How to display profile in VSCode

Summary

Research how to show the currently selected profile in VSCode workbench to make it more easily visible to user. If possible, implement the solution.

Desired Behavior

The profile the user has selected using the VsCode ext command: New Relic: Profiles Select Default should be clearly shown to them in the VsCode UI in the bottom information banner.

Currently it's far to the right, should we move closer to the left side? See Diagram.

Possible Solution

profile_name

Add type definition & documentation for NR1 package and components

Summary

One of the most requested features from user research interviews was autocompletion for imports, suggestions and inline documentation. We want to investigate how to include this with the VSCode extension.

Desired Behavior

  • Users can see what's available in the NR1 package
  • Users can get documentation about functions and components (params, props, etc) inline

Possible Solution

[Marketplace] How to add changelog

Summary

When viewing an extension in the VSCode marketplace, it has a tab called 'Changelog' with release notes. We want to understand how this tab gets populated.

Screen Shot 2020-07-29 at 12 09 21 PM

Desired Behavior

Possible Solution

Additional context

Add an explorer's hub topic for support

To comply with our open source standards via the open source checklist, let's add an explorer's hub topic and link it in the README.

Will post something similar to what we do with the Nerdpacks which is grab some helpful bits from the README and treat it as an initial "press release" in a sense.

  • Screenshot + Intro, what is it and why would you want to use it
  • How to use it, install/setup
  • Link to the repo

Example:
https://discuss.newrelic.com/t/announcing-a-new-relic-gatsby-site-theme/109814

Figure out how to get more usage stats on the extension usage

It seems Power BI used to have a stats extension you could install to get more stats on your extension usage, but it's no longer available according to this GH issue filed with the MS Docs team. So I'm trying to determine what else can be used to get more stats on the usage of extensions in the VS Code Marketplace.

Also there an interest to use custom events in New Relic to get more detailed observability data from the use of the our New Relic One extension so I am also exploring that.

Add command to search docs

Integrate the docs search into the VSCode Extension.

Possible approaches:

  1. Search command takes user to the search page and they type in search terms there.
  2. User types in search term from VSCode and is taken to search page with query params.

Add all NR1 Components as Snippets to the Extension

Summary

This is to make it easy and intuitive to program with NerdPacks. Having each component available as a Snippet would lower the barrier to entry for new users getting started, as well as allowing seasoned users to code quicker, and discover new components while in VS Code

Possible Solution

I created a VSCode extension for this separately, so the majority of the work is done, it would just involve integrating them into this repo to adhere to the same conventions.
https://github.com/rudouglas/nerdpack-snippets

Move the Synthetics extension under New Relic Extension pack

Interestingly, @tanben made his own VS Code ext. for a synthetics use case, and he was inquiring if we could add his functionality into our primary extension. We discussed a better approach would be to put this extension under an extension pack, so that all new relic extensions can be grouped together in the VsCode Marketplace and users can decided what extensions that need / want based on their use cases.

NPM registry and Github link to the workspace generator:

The Workspace generator helps to automated building workspaces for synthetics by quickly setting up a local version of a synthetics workspace.

https://www.npmjs.com/package/@tanben/generator-nrsynthetics-workspace
https://github.com/tanben/generator-nrsynthetics-workspace

Vs Code Ext

https://marketplace.visualstudio.com/items?itemName=BenedictoTan.step-line-generator
https://github.com/tanben/vsc-step-line-generator

NR Docs on Synthetics

https://docs.newrelic.com/docs/synthetics/synthetic-monitoring/getting-started/types-synthetic-monitors

Use Cases

  1. line and step numbers are commonly used to help with troubleshooting, since synthetics stack traces doesn't line up with the line number in the UI. Having the line number in the last message before the exception is thrown helps maintainers pinpoint where the issue issue is.

  2. step numbers are typically used for tracking different "step" within a testcase, for example a monitor for reservation/booking will have testcases and steps for each test cases, by tracking both we are able to identify which step in a test case is failing and how often and or how often a particular test case in the workflow is failing .

This allows us to build funnels like this:

image (1)

and PDF reports likes this

image (2)

  1. . synthetics scripts gets really long almost 1k lines of code.

here's a sample query, goal is to identify which step in the GuestInformation testCase failed and how often the step fails, "step" number:FROM Metric select count(*) as 'calls', count(status) as 'Failed' where monitorId='xxxxxxxxxxxxxxxxxxxx' and status='Fail' facet testCase, message , step limit max since 1 hours ago

Error handling

Audit current error handling and identify cases we might not be handling.

  • User doesn't have any profiles added -> send user to developer center
  • Standardize on how we display error messages
  • What happens if I try to create a nerdpack without a name?

Paths are broken on Windows

When running the extension on Windows, the paths to create a nerdpack are broken causing the extension to not work.

Fix NerdGraphQuery snippet

Description

There is a simple typo in the snippet. NerdgraphQuery needs to be NerdGraphQuery. Without this change the user has to figure out to manually correct the name.

Move to public GitHub repository in private repo

Summary

We are going to develop the NR1 VS Code extension in the open so it's time to shift the prototype to this GitHub repo.

Desired Behavior

Code is located in this repo.
Old internal repo is archived.
Our teammates github users have proper repo access (can access this repo since it is private and can merge PRs).

Create a dedicated page for VsCode under build apps

We will be adding a page dedicated to vscode ext. on the site under Build apps section. This way we can link to it from blogs, emails, etc.

AC

  • use an existing page template to handle page layout
  • create a product video for using VsCode Ext and add to page
  • explain the use of VScode and where to download it.
  • Maybe create a cool icon or logo for the extension for CTA areas throughout the site.

Create a New Relic Extension Pack to associated with other extensions.

Extension needs an icon

Hey there New Relic friends, nice extension you have here! We've featured your extension in the VS Code marketplace for this month and it looks like you could use an icon. 😄 ❤️

image

Decide on External communication

Summary

Get word out about the NR1 VSCode extension! John + Vi will primary be working on it with assistance from Cats Squad

  • A Discuss Post (John + Vi)
  • If the Developer blog is up by our launch, post it there (John + Vi)

Desired Behavior

Possible Solution

Additional context

Bug bash

Do a pass through of extension to find any lurking bugs.

Refactor existing code to be more readable

The prototype code needs some cleanup & refactoring for it to be production code.

Specifics that have been discussed:

  • Some renaming
  • Removing "vs-code-test")
  • Breaking up large functions
  • Modifying approach to triggering CLI commands if we come across a better approach.

Add more programmability commands

Summary

Not all CLI commands are supported in the prototype. The intention of this ticket is to add support for the remainder of commands that we'd like to support upon releasing the extension.

The list is going to be refined/added to, but here is the working list:

  • Create launcher
  • Create nerdlet
  • Regenerate UUID
  • List subscription(s)
  • Developer docs (takes user to dev site)
  • Add a profile
  • Undeploy

Command naming convention redo

We want to standardize on a command naming convention so users can see all the commands for New Relic or the commands for a sub-category

[Marketplace] Create an owning account

Summary

Create an owning account for extension in the VSCode marketplace.

##Acceptance Criteria

  1. Determine who should be owners of the extension.
  2. Determine who should be contributors of the extension.
  3. Ensure all people have 365 account tiles added to their OKTA profiles with IT so they can access the VSC marketplace.
  4. Provide account information to microsoft as that workflow is currently broken, so it's a manual process

Role types

https://docs.microsoft.com/en-us/visualstudio/extensibility/?view=vs-2019

Creator: The user can publish extensions, but cannot view or manage extensions published by other users.
Reader: The user can view extensions, but cannot publish or manage extensions.
Contributor: The user can publish and manage extensions, but cannot edit publisher settings or manage access.
Owner: The user can publish and manage extensions, edit publisher settings, and manage acces

Add a link to the VsCode Extension Pack download in the in product developer center

To help users find the extension easier, let's add a link the the marketplace to download the extension in the developer center.

AC

  1. Check if there are any security issues with linking out from the developer center.

  2. Ad a link to the [marketplace download page]https://marketplace.visualstudio.com/items?itemName=new-relic.new-relic-extension-pack) is added to the developer center.

  3. One thing to consider when linking to an external site from NR1 is that the Referer header could contain the entire URL, and those URLs contain a ton of data. To keep Microsoft from consuming our customer data, we’ll want to make sure the Referrer-Policy (oddly enough, they spelled ‘Referrer’ correctly here) is set properly. That probably looks like either Referrer-Policy: no-referrer or Referrer-Policy: origin

Screen Shot 2020-09-02 at 6 35 35 PM

Update profile command sends message “Your profile is set to undefined”

Steps to Reproduce

This was noticed in a user research session. We are not able to reproduce this ourselves just yet. There is a recording o fthe user research session that is likely to be helpful in better understanding whether this is a bug or not. Daniel should have the video.

This happens when a user runs the select profile command but exits out of it without selecting a profile.

Expected Behavior

We should be able to change the cli profile via the code extension.

[Marketplace] How does feature contributions tab get populated

Summary

When viewing an extension in the marketplace, there is a tab in the listing called 'Feature Contributions' that outlines what the extension provides. We would like to understand how this tab gets populated

Screen Shot 2020-07-29 at 12 00 22 PM

Desired Behavior

Possible Solution

Additional context

Nerdlife post

Summary

Get word out about the NR1 VSCode extension!

  • A Nerdlife Post

Desired Behavior

Possible Solution

Additional context

Too awesome

Description

Y'all are too awesome. Can't believe you got this out so fast!

Steps to Reproduce

Your awesomeness is not reproducible.

Expected Behavior

Wasn't expecting such a rad vs code extension so fast.

Relevant Logs / Console output

ERROR: TOTALLY DOP

Your Environment

Full of wonder and awe

Additional context

I'm impressed. Congrats!

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.